From d6d7c4bd1f364758525cfd87248f852f7ddc6160 Mon Sep 17 00:00:00 2001 From: Halali Date: Sat, 5 Jan 2019 15:55:27 +0100 Subject: [PATCH 1/2] Fix init script --- bazarr/init.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bazarr/init.py b/bazarr/init.py index ca8823c1a..2a358c301 100644 --- a/bazarr/init.py +++ b/bazarr/init.py @@ -93,9 +93,13 @@ try: db.close() providers_list = [] - if len(enabled_providers) > 0: + if enabled_providers: for provider in enabled_providers: providers_list.append(provider[0]) + else: + providers_list = None + + if settings_providers: for provider in settings_providers: if provider[0] == 'opensubtitles': settings.opensubtitles.username = provider[2] @@ -106,8 +110,6 @@ try: elif provider[0] == 'legendastv': settings.legendastv.username = provider[2] settings.legendastv.password = provider[3] - else: - providers_list = None settings.general.enabled_providers = u'' if not providers_list else ','.join(providers_list) with open(os.path.join(config_dir, 'config', 'config.ini'), 'w+') as handle: From 3ac4b75b88e2ae3bfde5ce472b57c8aa104d78dd Mon Sep 17 00:00:00 2001 From: Halali Date: Sun, 6 Jan 2019 13:12:31 +0100 Subject: [PATCH 2/2] Add exception for configparser import --- bazarr/init.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bazarr/init.py b/bazarr/init.py index 2a358c301..2e4b0a1a6 100644 --- a/bazarr/init.py +++ b/bazarr/init.py @@ -5,7 +5,10 @@ import logging import time from cork import Cork -from configparser import ConfigParser +try: + from configparser import ConfigParser +except ImportError: + from configparser2 import ConfigParser from config import settings from check_update import check_releases from get_argv import config_dir