handle "embedded-forced"
This commit is contained in:
@@ -120,12 +120,14 @@ class DefaultSubtitleHelper(SubtitleHelper):
|
||||
forced = ''
|
||||
default = ''
|
||||
split_tag = file.rsplit('.', 1)
|
||||
if len(split_tag) > 1 and split_tag[1].lower() in ['forced', 'normal', 'default', 'embedded', 'custom']:
|
||||
if len(split_tag) > 1 and split_tag[1].lower() in ['forced', 'normal', 'default', 'embedded', 'embedded-forced',
|
||||
'custom']:
|
||||
file = split_tag[0]
|
||||
sub_tag = split_tag[1].lower()
|
||||
# don't do anything with 'normal', we don't need it
|
||||
if 'forced' == split_tag[1].lower():
|
||||
if 'forced' in sub_tag:
|
||||
forced = '1'
|
||||
if 'default' == split_tag[1].lower():
|
||||
elif 'default' == sub_tag:
|
||||
default = '1'
|
||||
|
||||
# Attempt to extract the language from the filename (e.g. Avatar (2009).eng)
|
||||
|
||||
@@ -438,11 +438,12 @@ def _search_external_subtitles(path, forced_tag=False):
|
||||
adv_tag = None
|
||||
if len(split_tag) > 1:
|
||||
adv_tag = split_tag[1].lower()
|
||||
if adv_tag in ['forced', 'normal', 'default', 'embedded', 'custom']:
|
||||
if adv_tag in ['forced', 'normal', 'default', 'embedded', 'embedded-forced', 'custom']:
|
||||
p_root = split_tag[0]
|
||||
|
||||
# forced wanted but NIL
|
||||
if (forced_tag and adv_tag != "forced") or (not forced_tag and adv_tag == "forced"):
|
||||
forced = "forced" in adv_tag
|
||||
if (forced_tag and not forced) or (not forced_tag and forced):
|
||||
continue
|
||||
|
||||
# extract the potential language code
|
||||
|
||||
Reference in New Issue
Block a user