|
|
@ -88,10 +88,16 @@ else:
|
|
|
|
bottle.ERROR_PAGE_TEMPLATE = bottle.ERROR_PAGE_TEMPLATE.replace('if DEBUG and', 'if')
|
|
|
|
bottle.ERROR_PAGE_TEMPLATE = bottle.ERROR_PAGE_TEMPLATE.replace('if DEBUG and', 'if')
|
|
|
|
|
|
|
|
|
|
|
|
# Reset restart required warning on start
|
|
|
|
# Reset restart required warning on start
|
|
|
|
|
|
|
|
if System.select().count():
|
|
|
|
System.update({
|
|
|
|
System.update({
|
|
|
|
System.configured: 0,
|
|
|
|
System.configured: 0,
|
|
|
|
System.updated: 0
|
|
|
|
System.updated: 0
|
|
|
|
}).execute()
|
|
|
|
}).execute()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
System.insert({
|
|
|
|
|
|
|
|
System.configured: 0,
|
|
|
|
|
|
|
|
System.updated: 0
|
|
|
|
|
|
|
|
}).execute()
|
|
|
|
|
|
|
|
|
|
|
|
# Load languages in database
|
|
|
|
# Load languages in database
|
|
|
|
load_language_in_db()
|
|
|
|
load_language_in_db()
|
|
|
@ -188,21 +194,16 @@ def shutdown():
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
logging.error('BAZARR Cannot create bazarr.stop file.')
|
|
|
|
logging.error('BAZARR Cannot create bazarr.stop file.')
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
stop_file.write('')
|
|
|
|
server.stop()
|
|
|
|
stop_file.close()
|
|
|
|
|
|
|
|
database.close()
|
|
|
|
database.close()
|
|
|
|
database.stop()
|
|
|
|
database.stop()
|
|
|
|
server.stop()
|
|
|
|
stop_file.write('')
|
|
|
|
|
|
|
|
stop_file.close()
|
|
|
|
sys.exit(0)
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@route(base_url + 'restart')
|
|
|
|
@route(base_url + 'restart')
|
|
|
|
def restart():
|
|
|
|
def restart():
|
|
|
|
try:
|
|
|
|
|
|
|
|
server.stop()
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
logging.error('BAZARR Cannot stop CherryPy.')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
restart_file = open(os.path.join(args.config_dir, "bazarr.restart"), "w")
|
|
|
|
restart_file = open(os.path.join(args.config_dir, "bazarr.restart"), "w")
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
@ -210,10 +211,12 @@ def restart():
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# print 'Bazarr is being restarted...'
|
|
|
|
# print 'Bazarr is being restarted...'
|
|
|
|
logging.info('Bazarr is being restarted...')
|
|
|
|
logging.info('Bazarr is being restarted...')
|
|
|
|
restart_file.write('')
|
|
|
|
server.stop()
|
|
|
|
restart_file.close()
|
|
|
|
|
|
|
|
database.close()
|
|
|
|
database.close()
|
|
|
|
database.stop()
|
|
|
|
database.stop()
|
|
|
|
|
|
|
|
restart_file.write('')
|
|
|
|
|
|
|
|
restart_file.close()
|
|
|
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@route(base_url + 'wizard')
|
|
|
|
@route(base_url + 'wizard')
|
|
|
@ -439,7 +442,7 @@ def save_wizard():
|
|
|
|
settings_movie_default_hi = 'True'
|
|
|
|
settings_movie_default_hi = 'True'
|
|
|
|
settings.general.movie_default_hi = text_type(settings_movie_default_hi)
|
|
|
|
settings.general.movie_default_hi = text_type(settings_movie_default_hi)
|
|
|
|
|
|
|
|
|
|
|
|
settings_movie_default_forced = str(request.forms.getall('settings_movie_default_forced'))
|
|
|
|
settings_movie_default_forced = str(request.forms.get('settings_movie_default_forced'))
|
|
|
|
settings.general.movie_default_forced = text_type(settings_movie_default_forced)
|
|
|
|
settings.general.movie_default_forced = text_type(settings_movie_default_forced)
|
|
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
|
|
|
|
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
|
|
|
|