mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 22:10:42 +00:00
Avoid NoneType on providers pool updates
This commit is contained in:
parent
134613711a
commit
a783515ad4
1 changed files with 8 additions and 5 deletions
|
@ -105,10 +105,12 @@ class SZProviderPool(ProviderPool):
|
|||
# Check if the pool was initialized enough hours ago
|
||||
self._check_lifetime()
|
||||
|
||||
providers = set(providers or [])
|
||||
|
||||
# Check if any new provider has been added
|
||||
updated = set(providers) != self.providers or ban_list != self.ban_list
|
||||
removed_providers = list(sorted(self.providers - set(providers)))
|
||||
new_providers = list(sorted(set(providers) - self.providers))
|
||||
updated = providers != self.providers or ban_list != self.ban_list
|
||||
removed_providers = list(sorted(self.providers - providers))
|
||||
new_providers = list(sorted(providers - self.providers))
|
||||
|
||||
# Terminate and delete removed providers from instance
|
||||
for removed in removed_providers:
|
||||
|
@ -128,8 +130,6 @@ class SZProviderPool(ProviderPool):
|
|||
self.providers.difference_update(removed_providers)
|
||||
self.providers.update(list(providers))
|
||||
|
||||
self.blacklist = blacklist
|
||||
|
||||
# Restart providers with new configs
|
||||
for key, val in provider_configs.items():
|
||||
# Don't restart providers that are not enabled
|
||||
|
@ -154,6 +154,9 @@ class SZProviderPool(ProviderPool):
|
|||
|
||||
self.provider_configs = provider_configs
|
||||
|
||||
self.blacklist = blacklist or []
|
||||
self.ban_list = ban_list or {'must_contain': [], 'must_not_contain': []}
|
||||
|
||||
return updated
|
||||
|
||||
def _check_lifetime(self):
|
||||
|
|
Loading…
Reference in a new issue