From 4e03ec0acc5d07638ce5424bd68fa44b63e31fdc Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Fri, 25 Jun 2021 19:47:32 -0400 Subject: [PATCH] Fixed the Bazarr update process that was preventing moving back to master branch once you've started to use development/nightly. #1331 --- bazarr/check_update.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bazarr/check_update.py b/bazarr/check_update.py index 0db40b247..699342842 100644 --- a/bazarr/check_update.py +++ b/bazarr/check_update.py @@ -68,9 +68,10 @@ def check_if_new_update(): if release: logging.debug('BAZARR last release available is {}'.format(release['name'])) + current_version = None try: - semver.parse(os.environ["BAZARR_VERSION"]) - semver.parse(release['name'].lstrip('v')) + current_version = semver.VersionInfo.parse(os.environ["BAZARR_VERSION"]) + semver.VersionInfo.parse(release['name'].lstrip('v')) except ValueError: new_version = True else: @@ -81,6 +82,11 @@ def check_if_new_update(): if new_version and release['name'] != 'v0.9.1.1': logging.debug('BAZARR newer release available and will be downloaded: {}'.format(release['name'])) download_release(url=release['download_link']) + # rolling back from nightly to stable release + elif current_version: + if current_version.prerelease and not use_prerelease: + logging.debug('BAZARR previous stable version will be downloaded: {}'.format(release['name'])) + download_release(url=release['download_link']) else: logging.debug('BAZARR no newer release have been found') else: