diff options
author | morpheus65535 <[email protected]> | 2021-05-07 21:57:29 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-05-07 21:57:29 -0400 |
commit | b72d476d2eb3309a499e4060199092a6840fb005 (patch) | |
tree | 6d6fcc8d257c3b24336e3fc1f3dd5cceac84700a | |
parent | 4c3855b9b577e91c80b3c13a3aeef7663abcdb36 (diff) | |
download | bazarr-b72d476d2eb3309a499e4060199092a6840fb005.tar.gz bazarr-b72d476d2eb3309a499e4060199092a6840fb005.zip |
Added filter for unknown providers in settings.
-rw-r--r-- | bazarr/get_providers.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bazarr/get_providers.py b/bazarr/get_providers.py index fd60ce36c..6be3e4588 100644 --- a/bazarr/get_providers.py +++ b/bazarr/get_providers.py @@ -16,6 +16,7 @@ from subliminal_patch.exceptions import TooManyRequests, APIThrottled, ParseResp from subliminal.providers.opensubtitles import DownloadLimitReached from subliminal.exceptions import DownloadLimitExceeded, ServiceUnavailable from subliminal import region as subliminal_cache_region +from subliminal_patch.extensions import provider_registry def time_until_end_of_day(dt=None): @@ -91,7 +92,8 @@ def provider_pool(): def get_providers(): providers_list = [] - providers = get_array_from(settings.general.enabled_providers) + existing_providers = provider_registry.names() + providers = [x for x in get_array_from(settings.general.enabled_providers) if x in existing_providers] for provider in providers: reason, until, throttle_desc = tp.get(provider, (None, None, None)) providers_list.append(provider) @@ -247,7 +249,8 @@ def throttled_count(name): def update_throttled_provider(): changed = False - providers_list = get_array_from(settings.general.enabled_providers) + existing_providers = provider_registry.names() + providers_list = [x for x in get_array_from(settings.general.enabled_providers) if x in existing_providers] for provider in list(tp): if provider not in providers_list: @@ -281,7 +284,8 @@ def update_throttled_provider(): def list_throttled_providers(): update_throttled_provider() throttled_providers = [] - providers = get_array_from(settings.general.enabled_providers) + existing_providers = provider_registry.names() + providers = [x for x in get_array_from(settings.general.enabled_providers) if x in existing_providers] for provider in providers: reason, until, throttle_desc = tp.get(provider, (None, None, None)) throttled_providers.append([provider, reason, pretty.date(until)]) |