Skip to content

Commit

Permalink
Fixed indexing of unsupported language codes. #1683
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Jan 16, 2022
1 parent 3b3d6fe commit 9d30414
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bazarr/list_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def store_subtitles(original_path, reversed_path, use_cache=True):
logging.exception("BAZARR unable to index external subtitles.")
else:
for subtitle, language in subtitles.items():
if not language:
valid_language = alpha2_from_alpha3(language.alpha3)
if not valid_language:
logging.debug(f'{language.alpha3} is an unsupported language code.')
continue

subtitle_path = get_external_subtitles_path(reversed_path, subtitle)
Expand Down Expand Up @@ -188,7 +190,9 @@ def store_subtitles_movie(original_path, reversed_path, use_cache=True):
pass
else:
for subtitle, language in subtitles.items():
if not language:
valid_language = alpha2_from_alpha3(language.alpha3)
if not valid_language:
logging.debug(f'{language.alpha3} is an unsupported language code.')
continue

subtitle_path = get_external_subtitles_path(reversed_path, subtitle)
Expand Down

0 comments on commit 9d30414

Please sign in to comment.