diff --git a/updater.py b/updater.py index 56568fb..e8833f0 100644 --- a/updater.py +++ b/updater.py @@ -159,6 +159,7 @@ class UpdateCheckThread(QThread): current_version: str, platform_name: str, app_name: str, + beta_channel: bool = False, # Issue #112: Beta channel support ) -> None: super().__init__() @@ -167,6 +168,7 @@ class UpdateCheckThread(QThread): self.current_version = current_version self.platform_name = platform_name self.app_name = app_name + self.beta_channel = beta_channel or os.environ.get("FLARES_BETA_CHANNEL", "").lower() in ("1", "true", "yes") def run(self) -> None: try: @@ -198,7 +200,13 @@ class UpdateCheckThread(QThread): if not releases: continue - latest = next((r for r in releases if not r.get("prerelease") and not r.get("draft")), None) + # Issue #112: Support beta channel opt-in + if self.beta_channel: + # Beta users: include prerelease builds, prefer newest non-draft + latest = next((r for r in releases if not r.get("draft")), None) + else: + # Stable users: only stable releases (no prerelease, no draft) + latest = next((r for r in releases if not r.get("prerelease") and not r.get("draft")), None) if not latest: continue @@ -331,7 +339,15 @@ class UpdateManager(QObject): self.start_update_check_thread() def start_update_check_thread(self) -> None: - self.check_thread = UpdateCheckThread(self.api_url, self.api_url_sec, self.current_version, self.platform_name, self.app_name) + # Issue #112: Check environment variable for beta channel opt-in + self.check_thread = UpdateCheckThread( + self.api_url, + self.api_url_sec, + self.current_version, + self.platform_name, + self.app_name, + beta_channel=os.environ.get("FLARES_BETA_CHANNEL", "").lower() in ("1", "true", "yes") + ) self.check_thread.download_requested.connect(self.on_server_update_requested) self.check_thread.no_update_available.connect(self.on_server_no_update) self.check_thread.error_occurred.connect(self.on_error)