mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-20 12:53:05 +08:00
Fix for index out of range when no extension in filename.
This commit is contained in:
parent
7e277856f1
commit
7d3c6b31e7
1 changed files with 4 additions and 1 deletions
|
@ -612,7 +612,10 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
|
|||
forced = "forced" in adv_tag
|
||||
|
||||
# extract the potential language code
|
||||
language_code = p_root.rsplit(".", 1)[1].replace('_', '-')
|
||||
try:
|
||||
language_code = p_root.rsplit(".", 1)[1].replace('_', '-')
|
||||
except IndexError:
|
||||
language_code = None
|
||||
|
||||
# remove possible language code for matching
|
||||
p_root_bare = ENDSWITH_LANGUAGECODE_RE.sub("", p_root)
|
||||
|
|
Loading…
Reference in a new issue