diff options
author | Vitiko <[email protected]> | 2021-11-30 15:00:03 -0400 |
---|---|---|
committer | Vitiko <[email protected]> | 2021-11-30 15:00:03 -0400 |
commit | e1386aedc0c9e9bb2400af8f97027b4291fbd959 (patch) | |
tree | bd70ac51b11e38e3f8e1e96e60e8845432142036 /libs | |
parent | 4b8f0dbe814a69237a9afa596106949045777f13 (diff) | |
download | bazarr-e1386aedc0c9e9bb2400af8f97027b4291fbd959.tar.gz bazarr-e1386aedc0c9e9bb2400af8f97027b4291fbd959.zip |
Avoid breaking function with optional keyword parameter
Diffstat (limited to 'libs')
-rw-r--r-- | libs/subliminal_patch/score.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/subliminal_patch/score.py b/libs/subliminal_patch/score.py index 2d381f412..3e6d1edcb 100644 --- a/libs/subliminal_patch/score.py +++ b/libs/subliminal_patch/score.py @@ -30,8 +30,8 @@ def framerate_equal(source, check): def compute_score(matches, subtitle, video, hearing_impaired=None, score_obj=None): """Compute the score of the `subtitle` against the `video` with `hearing_impaired` preference. - - patch: + + patch: - remove upper bounds of score - re-add matches argument and remove get_matches from here @@ -49,8 +49,11 @@ def compute_score(matches, subtitle, video, hearing_impaired=None, score_obj=Non """ logger.info('%r: Computing score for video %r with %r', subtitle, video, dict(hearing_impaired=hearing_impaired)) - scores = score_obj.scores or get_scores(video) - score_obj.check_custom_profiles(subtitle, matches) + if score_obj is not None: + scores = score_obj.scores + score_obj.check_custom_profiles(subtitle, matches) + else: + scores = get_scores(video) is_episode = isinstance(video, Episode) is_movie = isinstance(video, Movie) |