Fixed issues with new database creation since e6d0893812

This commit is contained in:
morpheus65535 2022-12-15 11:00:56 -05:00
parent 71e749724f
commit 6693b98811
2 changed files with 7 additions and 11 deletions

View File

@ -108,14 +108,6 @@ 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

View File

@ -10,11 +10,11 @@ import time
import rarfile
from dogpile.cache.region import register_backend as register_cache_backend
from subliminal_patch.extensions import provider_registry
from app.config import settings, configure_captcha_func
from app.config import settings, configure_captcha_func, get_array_from
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
@ -195,7 +195,11 @@ with open(os.path.normpath(os.path.join(args.config_dir, 'config', 'config.ini')
# Remove deprecated providers from enabled providers in config.ini
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 init_binaries():