summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-02-25 08:43:35 -0500
committermorpheus65535 <[email protected]>2023-02-25 08:43:35 -0500
commit7502c596380236a34cf6516c5d88b1877c5e0ec5 (patch)
treebd5116168221a92f9fe2ed2a54c8a9848db78794
parent019613958e5736a5adfdfc2527ebc753805e6c9c (diff)
downloadbazarr-7502c596380236a34cf6516c5d88b1877c5e0ec5.tar.gz
bazarr-7502c596380236a34cf6516c5d88b1877c5e0ec5.zip
no log: small fix for announcements and enabled providers
-rw-r--r--bazarr/app/announcements.py4
-rw-r--r--bazarr/app/get_providers.py9
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")