From 32a010ed404b6817233211b655a67dd86aaab1b2 Mon Sep 17 00:00:00 2001 From: Reditus Date: Thu, 14 May 2026 01:03:28 +0100 Subject: [PATCH] fix: detect branch from folder name for ZIP downloads, preventing false update alerts on nightly/beta builds --- app/services/updater.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/services/updater.py b/app/services/updater.py index 79e1c48..3833c8c 100644 --- a/app/services/updater.py +++ b/app/services/updater.py @@ -45,13 +45,23 @@ class UpdateService: self._current_branch = self._detect_branch() def _detect_branch(self): - """Detect the current git branch.""" + """Detect the current git branch or ZIP branch from folder name.""" try: branch = subprocess.check_output( ['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=self.project_root, stderr=subprocess.DEVNULL ).decode().strip() - return branch if branch else 'main' + if branch: + return branch + except Exception: + pass + + folder_name = os.path.basename(self.project_root).lower() + if 'nightly' in folder_name: + return 'nightly' + if 'beta' in folder_name: + return 'beta' + return 'main' except Exception: return 'main'