From e862c811c2cf45217e44f85c90ed65f51de873d1 Mon Sep 17 00:00:00 2001
From: oop7 <110548351+oop7@users.noreply.github.com>
Date: Sat, 1 Nov 2025 12:43:58 +0200
Subject: [PATCH] Use APP_VERSION constant for version display
Replaces hardcoded version strings with the APP_VERSION constant in both the main window and About dialog. This ensures version consistency across the application and simplifies future version updates.
---
src/gui/ytsage_gui_dialogs/ytsage_dialogs_base.py | 4 +++-
src/gui/ytsage_gui_main.py | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/gui/ytsage_gui_dialogs/ytsage_dialogs_base.py b/src/gui/ytsage_gui_dialogs/ytsage_dialogs_base.py
index f7b9a07..b5788d4 100644
--- a/src/gui/ytsage_gui_dialogs/ytsage_dialogs_base.py
+++ b/src/gui/ytsage_gui_dialogs/ytsage_dialogs_base.py
@@ -19,6 +19,7 @@ from PySide6.QtWidgets import (
QWidget,
)
+from src import __version__ as APP_VERSION
from src.utils.ytsage_localization import _
from src.core.ytsage_ffmpeg import get_ffmpeg_path
@@ -159,7 +160,8 @@ class AboutDialog(QDialog):
layout.addWidget(title_label)
version_label = QLabel(
- f"{_('about.version', version=getattr(self._parent, 'version', '4.9.2'))}"
+ f""
+ f"{_('about.version', version=getattr(self._parent, 'version', APP_VERSION))}"
)
version_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
layout.addWidget(version_label)
diff --git a/src/gui/ytsage_gui_main.py b/src/gui/ytsage_gui_main.py
index a9df620..ae8c091 100644
--- a/src/gui/ytsage_gui_main.py
+++ b/src/gui/ytsage_gui_main.py
@@ -28,6 +28,7 @@ from PySide6.QtWidgets import (
QWidget,
)
+from src import __version__ as APP_VERSION
from src.core.ytsage_downloader import DownloadThread, SignalManager # Import downloader related classes
from src.core.ytsage_utils import check_ffmpeg, load_saved_path, parse_yt_dlp_error, save_path, should_check_for_auto_update, validate_video_url
from src.core.ytsage_yt_dlp import get_yt_dlp_path, setup_ytdlp # Import the new yt-dlp functions
@@ -78,7 +79,7 @@ class YTSageApp(QMainWindow, FormatTableMixin, VideoInfoMixin): # Inherit from
else:
logger.info(f"Using yt-dlp from: {ytdlp_path}")
- self.version = "4.9.2"
+ self.version = APP_VERSION
self.check_for_updates()
# Check for auto-updates if enabled