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

subtitle_filter: rewrite function to work as intended

This commit is contained in:
Johan Andersson 2021-05-24 20:50:38 +02:00
parent fed357e432
commit d68b3e3d7a

View File

@ -81,12 +81,13 @@ def subtitle_filter(subtitles) -> List:
for sub in subtitles:
if sub.subfix not in languages:
if not all_subs and sub.subfix == preferred:
if all_subs:
subs.append(sub)
languages.append(sub.subfix)
else:
subs.append(sub)
languages.append(sub.subfix)
if sub.subfix == preferred:
subs.append(sub)
languages.append(sub.subfix)
return subs