From 5a41c1b0e240955bba1e5e91aa7e184605529374 Mon Sep 17 00:00:00 2001 From: evilhero Date: Tue, 14 Oct 2014 20:03:18 -0400 Subject: [PATCH] FIX: On new installations, would error out on a string strip call for the CV API key --- mylar/__init__.py | 5 ++++- mylar/webserve.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mylar/__init__.py b/mylar/__init__.py index 39c09265..325bd6e5 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -1044,7 +1044,10 @@ def config_write(): new_config.encoding = 'UTF8' new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION - new_config['General']['comicvine_api'] = COMICVINE_API.strip() + if COMICVINE_API is None or COMICVINE_API == '': + new_config['General']['comicvine_api'] = COMICVINE_API + else: + new_config['General']['comicvine_api'] = COMICVINE_API.strip() #write the current CV API time / count here so it's persistent through reboots/restarts. #get the current values. helpers.cvapi_check() diff --git a/mylar/webserve.py b/mylar/webserve.py index a2389ffd..dca506ae 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -3007,7 +3007,7 @@ class WebInterface(object): pushbullet_enabled=0, pushbullet_apikey=None, pushbullet_deviceid=None, pushbullet_onsnatch=0, preferred_quality=0, move_files=0, rename_files=0, add_to_csv=1, cvinfo=0, lowercase_filenames=0, folder_format=None, file_format=None, enable_extra_scripts=0, extra_scripts=None, enable_pre_scripts=0, pre_scripts=None, post_processing=0, syno_fix=0, search_delay=None, chmod_dir=0777, chmod_file=0660, cvapifix=0, tsab=None, destination_dir=None, create_folders=1, replace_spaces=0, replace_char=None, use_minsize=0, minsize=None, use_maxsize=0, maxsize=None, autowant_all=0, autowant_upcoming=0, comic_cover_local=0, zero_level=0, zero_level_n=None, interface=None, **kwargs): - mylar.COMICVINE_API = comicvine_api.strip() + mylar.COMICVINE_API = comicvine_api mylar.HTTP_HOST = http_host mylar.HTTP_PORT = http_port mylar.HTTP_USERNAME = http_username