diff options
author | Lawrence A <[email protected]> | 2024-02-02 21:24:28 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-02 16:24:28 -0500 |
commit | 4029c9f712b7718eca89c5dd2e4d29c3f5b2762e (patch) | |
tree | d49e216bee1ab2a1d8e54b4bc5318c51b91f500a | |
parent | fb660a0e6ea4d45c9cab0a49008d4e65d31b355c (diff) | |
download | bazarr-4029c9f712b7718eca89c5dd2e4d29c3f5b2762e.tar.gz bazarr-4029c9f712b7718eca89c5dd2e4d29c3f5b2762e.zip |
Fixed forced subtitles download loopv1.4.1-beta.22v1.4.1
Searching for the best forced subtitles for a given language was
resulting in all forced subtitles for that language being downloaded in
descending score order until the minimum score was reached.
Not only did this burn through any download limits imposed by providers,
it left poor quality subtitles downloaded (which could later be
automatically upgraded to the first choice).
This change uses the string conversion of Language objects instead of
their basenames when working out when to stop downloading subtitles, as
this takes into account the forced flag while still ignoring the hearing
impaired flag.
-rw-r--r-- | libs/subliminal_patch/core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/subliminal_patch/core.py b/libs/subliminal_patch/core.py index 59cfd22a3..3c7e00479 100644 --- a/libs/subliminal_patch/core.py +++ b/libs/subliminal_patch/core.py @@ -574,12 +574,12 @@ class SZProviderPool(ProviderPool): break # stop when all languages are downloaded - if set(s.language.basename for s in downloaded_subtitles) == languages: + if set(str(s.language) for s in downloaded_subtitles) == languages: logger.debug('All languages downloaded') break # check downloaded languages - if subtitle.language in set(s.language.basename for s in downloaded_subtitles): + if subtitle.language in set(str(s.language) for s in downloaded_subtitles): logger.debug('%r: Skipping subtitle: already downloaded', subtitle.language) continue |