|
|
@ -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
|
|
|
|
System.update({
|
|
|
|
if System.select().count():
|
|
|
|
System.configured: 0,
|
|
|
|
System.update({
|
|
|
|
System.updated: 0
|
|
|
|
System.configured: 0,
|
|
|
|
}).execute()
|
|
|
|
System.updated: 0
|
|
|
|
|
|
|
|
}).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,32 +194,29 @@ 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:
|
|
|
|
try:
|
|
|
|
server.stop()
|
|
|
|
restart_file = open(os.path.join(args.config_dir, "bazarr.restart"), "w")
|
|
|
|
except:
|
|
|
|
except Exception as e:
|
|
|
|
logging.error('BAZARR Cannot stop CherryPy.')
|
|
|
|
logging.error('BAZARR Cannot create bazarr.restart file.')
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
# print 'Bazarr is being restarted...'
|
|
|
|
restart_file = open(os.path.join(args.config_dir, "bazarr.restart"), "w")
|
|
|
|
logging.info('Bazarr is being restarted...')
|
|
|
|
except Exception as e:
|
|
|
|
server.stop()
|
|
|
|
logging.error('BAZARR Cannot create bazarr.restart file.')
|
|
|
|
database.close()
|
|
|
|
else:
|
|
|
|
database.stop()
|
|
|
|
# print 'Bazarr is being restarted...'
|
|
|
|
restart_file.write('')
|
|
|
|
logging.info('Bazarr is being restarted...')
|
|
|
|
restart_file.close()
|
|
|
|
restart_file.write('')
|
|
|
|
sys.exit(0)
|
|
|
|
restart_file.close()
|
|
|
|
|
|
|
|
database.close()
|
|
|
|
|
|
|
|
database.stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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:
|
|
|
|