From e21651e198965c9836d725b3a353e862d6e3fd26 Mon Sep 17 00:00:00 2001 From: Halali Date: Sun, 17 Feb 2019 20:07:21 +0100 Subject: [PATCH] add restart after update --- bazarr/check_update.py | 6 +++++- bazarr/config.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bazarr/check_update.py b/bazarr/check_update.py index 78cf77565..f65392231 100644 --- a/bazarr/check_update.py +++ b/bazarr/check_update.py @@ -11,7 +11,7 @@ import sqlite3 import json from get_args import args -from config import settings +from config import settings, bazarr_url def check_releases(): @@ -375,3 +375,7 @@ def updated(): c.execute("UPDATE system SET updated = 1") conn.commit() c.close() + try: + requests.get(bazarr_url + 'restart') + except requests.ConnectionError: + logging.info('BAZARR: Restart failed, please restart Bazarr manualy') diff --git a/bazarr/config.py b/bazarr/config.py index 895488068..7e3839f1a 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -91,6 +91,7 @@ settings = simpleconfigparser(defaults=defaults) settings.read(os.path.join(args.config_dir, 'config', 'config.ini')) base_url = settings.general.base_url +bazarr_url = 'http://localhost:' + (args.port if args.port else settings.general.port) + base_url # sonarr url if settings.sonarr.getboolean('ssl'):