Skip to content

Commit

Permalink
Fixed external subtitles with unknown language causing exception duri…
Browse files Browse the repository at this point in the history
…ng indexing. #1709
  • Loading branch information
morpheus65535 committed Feb 6, 2022
1 parent aa7847a commit d160f1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bazarr/list_subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def store_subtitles(original_path, reversed_path, use_cache=True):
if language:
if hasattr(language, 'alpha3'):
valid_language = alpha2_from_alpha3(language.alpha3)
else:
logging.debug(f"Skipping subtitles because we are unable to define language: {subtitle}")
continue

if not valid_language:
logging.debug(f'{language.alpha3} is an unsupported language code.')
continue
Expand Down Expand Up @@ -197,6 +201,10 @@ def store_subtitles_movie(original_path, reversed_path, use_cache=True):
if language:
if hasattr(language, 'alpha3'):
valid_language = alpha2_from_alpha3(language.alpha3)
else:
logging.debug(f"Skipping subtitles because we are unable to define language: {subtitle}")
continue

if not valid_language:
logging.debug(f'{language.alpha3} is an unsupported language code.')
continue
Expand Down

0 comments on commit d160f1e

Please sign in to comment.