don't check for language code if the subtitle file name is the same as the video name

if the subtitle file name is the same as the video name, it is pointless to check the language code
This commit is contained in:
josdion 2020-06-09 20:11:48 +03:00
parent 183fc8f7d3
commit ca0123c036
1 changed files with 5 additions and 0 deletions

View File

@ -605,6 +605,11 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
if not INCLUDE_EXOTIC_SUBS and p_ext not in (".srt", ".ass", ".ssa", ".vtt"):
continue
if p_root.lower() == fn_no_ext_lower:
# skip check for language code is the subtitle file name is the same as the video name
subtitles[p] = None
continue
# extract potential forced/normal/default tag
# fixme: duplicate from subtitlehelpers
split_tag = p_root.rsplit('.', 1)