1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

subtitle: when preferred is none get all subs.

fixes: #1391
This commit is contained in:
Johan Andersson 2021-06-02 20:41:13 +02:00
parent be4d2ec296
commit 88432ed5ea
2 changed files with 5 additions and 2 deletions

View File

@ -152,7 +152,7 @@ class streamSubtile(unittest.TestCase):
subtitle(setup_defaults(), "wrst", "http://example.com", "sv"), subtitle(setup_defaults(), "wrst", "http://example.com", "sv"),
] ]
subs = subtitle_filter(test_subs) subs = subtitle_filter(test_subs)
assert len(subs) == 1 assert len(subs) == 3
def test_subtitleFilter2(self): def test_subtitleFilter2(self):
config = setup_defaults() config = setup_defaults()

View File

@ -85,7 +85,10 @@ def subtitle_filter(subtitles) -> List:
subs.append(sub) subs.append(sub)
languages.append(sub.subfix) languages.append(sub.subfix)
else: else:
if sub.subfix == preferred: if preferred is None:
subs.append(sub)
languages.append(sub.subfix)
if preferred and sub.subfix == preferred:
subs.append(sub) subs.append(sub)
languages.append(sub.subfix) languages.append(sub.subfix)
return subs return subs