1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +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: for sub in subtitles:
if sub.subfix not in languages: if sub.subfix not in languages:
if not all_subs and sub.subfix == preferred: if all_subs:
subs.append(sub) subs.append(sub)
languages.append(sub.subfix) languages.append(sub.subfix)
else: else:
subs.append(sub) if sub.subfix == preferred:
languages.append(sub.subfix) subs.append(sub)
languages.append(sub.subfix)
return subs return subs