no log: fixed stuff to prevent exception

This commit is contained in:
morpheus65535 2023-10-01 14:06:16 -04:00
parent bad77e2ce7
commit 2467bc0bc0
1 changed files with 2 additions and 2 deletions

View File

@ -149,13 +149,13 @@ def process_subtitle(subtitle, media_type, audio_language, path, max_score, is_u
reversed_subtitles_path=reversed_subtitles_path,
hearing_impaired=subtitle.language.hi,
matched=list(subtitle.matches or []),
not_matched=_get_not_matched(subtitle, media_type)) or [],
not_matched=_get_not_matched(subtitle, media_type)),
def _get_not_matched(subtitle, media_type):
_, _, scores = _get_scores(media_type)
if 'hash' not in subtitle.matches:
if subtitle.matches and isinstance(subtitle.matches, set) and 'hash' not in subtitle.matches:
return list(set(scores) - set(subtitle.matches))
else:
return []