diff options
-rw-r--r-- | bazarr/app/announcements.py | 4 | ||||
-rw-r--r-- | bazarr/app/get_providers.py | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/bazarr/app/announcements.py b/bazarr/app/announcements.py index 4c49dce24..be01d67a7 100644 --- a/bazarr/app/announcements.py +++ b/bazarr/app/announcements.py @@ -10,7 +10,7 @@ import pretty from datetime import datetime from operator import itemgetter -from app.get_providers import get_providers +from app.get_providers import get_enabled_providers from app.database import TableAnnouncements from .get_args import args @@ -74,7 +74,7 @@ def get_local_announcements(): announcements = [] # opensubtitles.org end-of-life - enabled_providers = get_providers() + enabled_providers = get_enabled_providers() if enabled_providers and 'opensubtitles' in enabled_providers: announcements.append({ 'text': 'Opensubtitles.org will be deprecated soon, migrate to Opensubtitles.com ASAP and disable this ' diff --git a/bazarr/app/get_providers.py b/bazarr/app/get_providers.py index c3bccd446..d73c109b6 100644 --- a/bazarr/app/get_providers.py +++ b/bazarr/app/get_providers.py @@ -1,5 +1,6 @@ # coding=utf-8 +import ast import os import datetime import pytz @@ -143,6 +144,14 @@ def get_providers(): return providers_list +def get_enabled_providers(): + # return enabled provider including those who can be throttled + try: + return ast.literal_eval(settings.general.enabled_providers) + except (ValueError, TypeError, SyntaxError, MemoryError, RecursionError): + return [] + + _FFPROBE_BINARY = get_binary("ffprobe") _FFMPEG_BINARY = get_binary("ffmpeg") |