From ab7d77800ae0af11fc1f720a48b553bb515b21a8 Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:20:56 +0200 Subject: [PATCH] Include video id in default filename format Add video id to the default output filename template across the downloader and settings UI. The template was changed from "%(title)s_%(resolution)s.%(ext)s" to "%(title)s_%(resolution)s_[%(id)s].%(ext)s" in ytsage_downloader.py and ytsage_dialogs_settings.py (including placeholder and reset behavior). This helps avoid filename collisions and makes downloaded files easier to identify. --- ytsage/core/ytsage_downloader.py | 2 +- ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ytsage/core/ytsage_downloader.py b/ytsage/core/ytsage_downloader.py index ed545b2..3df0fe7 100644 --- a/ytsage/core/ytsage_downloader.py +++ b/ytsage/core/ytsage_downloader.py @@ -302,7 +302,7 @@ class DownloadThread(QThread): base_path: str = self.path.as_posix() # Determine the filename part of the template - filename_part = self.filename_format if self.filename_format else "%(title)s_%(resolution)s.%(ext)s" + filename_part = self.filename_format if self.filename_format else "%(title)s_%(resolution)s_[%(id)s].%(ext)s" if self.is_playlist: # Create output template with playlist subfolder diff --git a/ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py b/ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py index 23294c3..76f727b 100644 --- a/ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py +++ b/ytsage/gui/ytsage_gui_dialogs/ytsage_dialogs_settings.py @@ -387,18 +387,18 @@ class DownloadSettingsDialog(QDialog): filename_layout = QVBoxLayout() # Load current filename format from ConfigManager - self.filename_format_value = ConfigManager.get("filename_format") or "%(title)s_%(resolution)s.%(ext)s" + self.filename_format_value = ConfigManager.get("filename_format") or "%(title)s_%(resolution)s_[%(id)s].%(ext)s" # Input and Reset Button Layout filename_input_layout = QHBoxLayout() self.filename_format_input = QLineEdit(self.filename_format_value) - self.filename_format_input.setPlaceholderText("%(title)s_%(resolution)s.%(ext)s") + self.filename_format_input.setPlaceholderText("%(title)s_%(resolution)s_[%(id)s].%(ext)s") filename_input_layout.addWidget(self.filename_format_input) self.reset_format_button = QPushButton(_("buttons.reset")) self.reset_format_button.setFixedWidth(70) - self.reset_format_button.clicked.connect(lambda: self.filename_format_input.setText("%(title)s_%(resolution)s.%(ext)s")) + self.reset_format_button.clicked.connect(lambda: self.filename_format_input.setText("%(title)s_%(resolution)s_[%(id)s].%(ext)s")) filename_input_layout.addWidget(self.reset_format_button) filename_layout.addLayout(filename_input_layout)