From 4eabaa869ec8ceaf38bf0d42c19f9b59dd6b4c77 Mon Sep 17 00:00:00 2001 From: Halali Date: Sun, 31 Mar 2019 22:10:46 +0200 Subject: [PATCH] Continue developing --- bazarr/check_update.py | 3 +-- bazarr/main.py | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bazarr/check_update.py b/bazarr/check_update.py index febdfd268..48ff2f529 100644 --- a/bazarr/check_update.py +++ b/bazarr/check_update.py @@ -132,7 +132,6 @@ def check_updates(): elif commits_behind is 0: notifications.write(msg='BAZARR is up to date', queue='check_update') logging.info('BAZARR is up to date') - else: url = 'https://api.github.com/repos/morpheus65535/bazarr/releases' releases = request_json(url, timeout=20, whitelist_status_code=404, validator=lambda x: type(x) == list) @@ -253,7 +252,7 @@ def update(source, restart=True): def checkout_git_branch(): - output, err = run_git('fetch %s' % 'origin') + output, err = run_git('fetch origin') output, err = run_git('checkout %s' % settings.general.branch) if not output: diff --git a/bazarr/main.py b/bazarr/main.py index 9ce773e21..42039f035 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -67,6 +67,7 @@ from notifier import send_notifications, send_notifications_movie from config import settings, url_sonarr, url_radarr, url_radarr_short, url_sonarr_short, base_url from helper import path_replace_movie, get_subtitle_destination_folder from subliminal_patch.extensions import provider_registry as provider_manager +from check_update import checkout_git_branch reload(sys) sys.setdefaultencoding('utf8') @@ -1285,6 +1286,7 @@ def save_settings(): after = (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_pathmapping), unicode(settings_general_use_sonarr), unicode(settings_general_use_radarr), unicode(settings_general_pathmapping_movie)) + updater_before = settings.general.branch settings.general.ip = text_type(settings_general_ip) settings.general.port = text_type(settings_general_port) @@ -1536,6 +1538,9 @@ def save_settings(): radarr_full_update() logging.info('BAZARR Settings saved succesfully.') + + if updater_before != settings_general_branch: + checkout_git_branch() if ref.find('saved=true') > 0: redirect(ref)