diff --git a/headphones/db.py b/headphones/db.py index 871b7c99..f25636be 100644 --- a/headphones/db.py +++ b/headphones/db.py @@ -35,6 +35,10 @@ def dbFilename(filename="headphones.db"): return os.path.join(headphones.DATA_DIR, filename) def getCacheSize(): + #this will protect against typecasting problems produced by empty string and None settings + if not headphones.CACHE_SIZEMB: + #sqlite will work with this (very slowly) + return 0 return int(headphones.CACHE_SIZEMB) class DBConnection: diff --git a/headphones/webserve.py b/headphones/webserve.py index 3a508c51..34315f7b 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -680,7 +680,7 @@ class WebInterface(object): samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, delete_lossless_files=0, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, synoindex_enabled=False, mirror=None, customhost=None, customport=None, - customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, cache_sizemb=None, **kwargs): + customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, cache_sizemb=0, **kwargs): headphones.HTTP_HOST = http_host headphones.HTTP_PORT = http_port @@ -783,7 +783,7 @@ class WebInterface(object): headphones.CUSTOMSLEEP = customsleep headphones.HPUSER = hpuser headphones.HPPASS = hppass - headphones.CACHE_SIZEMB = cache_sizemb + headphones.CACHE_SIZEMB = int(cache_sizemb) # Handle the variable config options. Note - keys with False values aren't getting passed