diff --git a/lib/svtplay_dl/tests/test_stream.py b/lib/svtplay_dl/tests/test_stream.py index 4055339..61525bf 100644 --- a/lib/svtplay_dl/tests/test_stream.py +++ b/lib/svtplay_dl/tests/test_stream.py @@ -152,7 +152,7 @@ class streamSubtile(unittest.TestCase): subtitle(setup_defaults(), "wrst", "http://example.com", "sv"), ] subs = subtitle_filter(test_subs) - assert len(subs) == 1 + assert len(subs) == 3 def test_subtitleFilter2(self): config = setup_defaults() diff --git a/lib/svtplay_dl/utils/stream.py b/lib/svtplay_dl/utils/stream.py index 7b275a8..59e4a41 100644 --- a/lib/svtplay_dl/utils/stream.py +++ b/lib/svtplay_dl/utils/stream.py @@ -85,7 +85,10 @@ def subtitle_filter(subtitles) -> List: subs.append(sub) languages.append(sub.subfix) 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) languages.append(sub.subfix) return subs