mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-03-06 19:59:31 +08:00
Fixed issue with unrecognized languages while indexing subtitles (mainly for those without a language code in filename).
This commit is contained in:
parent
415087fd13
commit
28663a6937
1 changed files with 8 additions and 2 deletions
|
@ -86,6 +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():
|
||||
valid_language = False
|
||||
if language:
|
||||
if hasattr(language, 'alpha3'):
|
||||
valid_language = alpha2_from_alpha3(language.alpha3)
|
||||
if not valid_language:
|
||||
logging.debug(f'{language.alpha3} is an unsupported language code.')
|
||||
|
@ -190,6 +193,9 @@ def store_subtitles_movie(original_path, reversed_path, use_cache=True):
|
|||
pass
|
||||
else:
|
||||
for subtitle, language in subtitles.items():
|
||||
valid_language = False
|
||||
if language:
|
||||
if hasattr(language, 'alpha3'):
|
||||
valid_language = alpha2_from_alpha3(language.alpha3)
|
||||
if not valid_language:
|
||||
logging.debug(f'{language.alpha3} is an unsupported language code.')
|
||||
|
|
Loading…
Reference in a new issue