mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-23 22:27:17 -04:00
Fixed forced subtitles download loop
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.
This commit is contained in:
parent
fb660a0e6e
commit
4029c9f712
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue