1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2025-03-04 10:28:15 +00:00

Fix for invalid language code.

This commit is contained in:
Louis Vézina 2019-10-07 14:50:16 -04:00
parent ba2920423c
commit 7c75ae7615

View file

@ -614,6 +614,10 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
# extract the potential language code # extract the potential language code
try: try:
language_code = p_root.rsplit(".", 1)[1].replace('_', '-') language_code = p_root.rsplit(".", 1)[1].replace('_', '-')
try:
language_code = Language.fromietf(language_code)
except ValueError:
language_code = None
except IndexError: except IndexError:
language_code = None language_code = None