mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-08 15:57:36 +08:00
Added routine to remove deprecated providers from enabled providers in config.ini
This commit is contained in:
parent
993168e901
commit
e6d0893812
2 changed files with 13 additions and 0 deletions
|
@ -108,6 +108,14 @@ PROVIDERS_FORCED_OFF = ["addic7ed", "tvsubtitles", "legendasdivx", "legendastv",
|
|||
throttle_count = {}
|
||||
|
||||
|
||||
def clean_enabled_providers():
|
||||
existing_providers = provider_registry.names()
|
||||
enabled_providers = get_array_from(settings.general.enabled_providers)
|
||||
settings.general.enabled_providers = str([x for x in enabled_providers if x in existing_providers])
|
||||
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
|
||||
settings.write(handle)
|
||||
|
||||
|
||||
def provider_pool():
|
||||
if settings.general.getboolean('multithreading'):
|
||||
return subliminal_patch.core.SZAsyncProviderPool
|
||||
|
|
|
@ -14,6 +14,7 @@ from dogpile.cache.region import register_backend as register_cache_backend
|
|||
from app.config import settings, configure_captcha_func
|
||||
from app.get_args import args
|
||||
from app.logger import configure_logging
|
||||
from app.get_providers import clean_enabled_providers
|
||||
from utilities.binaries import get_binary, BinaryNotFound
|
||||
from utilities.path_mappings import path_mappings
|
||||
from utilities.backup import restore_from_backup
|
||||
|
@ -193,6 +194,10 @@ with open(os.path.normpath(os.path.join(args.config_dir, 'config', 'config.ini')
|
|||
settings.write(handle)
|
||||
|
||||
|
||||
# Remove deprecated providers from enabled providers in config.ini
|
||||
clean_enabled_providers()
|
||||
|
||||
|
||||
def init_binaries():
|
||||
try:
|
||||
exe = get_binary("unar")
|
||||
|
|
Loading…
Reference in a new issue