Added minimum search interval time of 6 hours

This commit is contained in:
rembo10
2012-12-08 21:29:45 -05:00
parent ae68771657
commit 875c3e1393
2 changed files with 11 additions and 1 deletions

View File

@@ -350,7 +350,7 @@ def initialize():
AUTOWANT_UPCOMING = bool(check_setting_int(CFG, 'General', 'autowant_upcoming', 1))
AUTOWANT_ALL = bool(check_setting_int(CFG, 'General', 'autowant_all', 0))
SEARCH_INTERVAL = check_setting_int(CFG, 'General', 'search_interval', 360)
SEARCH_INTERVAL = check_setting_int(CFG, 'General', 'search_interval', 1440)
LIBRARYSCAN = bool(check_setting_int(CFG, 'General', 'libraryscan', 1))
LIBRARYSCAN_INTERVAL = check_setting_int(CFG, 'General', 'libraryscan_interval', 300)
DOWNLOAD_SCAN_INTERVAL = check_setting_int(CFG, 'General', 'download_scan_interval', 5)
@@ -529,6 +529,11 @@ def initialize():
os.makedirs(CACHE_DIR)
except OSError:
logger.error('Could not create cache dir. Check permissions of datadir: ' + DATA_DIR)
# Sanity check for search interval. Set it to at least 6 hours
if SEARCH_INTERVAL < 360:
logger.info("Search interval too low. Resetting to 6 hour minimum")
SEARCH_INTERVAL = 360
# Initialize the database
logger.info('Checking to see if the database has all tables....')

View File

@@ -832,6 +832,11 @@ class WebInterface(object):
headphones.EXTRAS = ','.join(str(n) for n in temp_extras_list)
# Sanity checking
if headphones.SEARCH_INTERVAL < 360:
logger.info("Search interval too low. Resetting to 6 hour minimum")
headphones.SEARCH_INTERVAL = 360
# Write the config
headphones.config_write()