mirror of
https://github.com/morpheus65535/bazarr.git
synced 2026-03-10 03:04:29 +08:00
Fixed external subtitles with unknown language causing exception during indexing. #1709
This commit is contained in:
parent
aa7847acf3
commit
d160f1e4eb
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue