From 9b085aa54743b839b925de5a0d7e1672eeb032af Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Fri, 10 Apr 2026 17:10:58 +0200 Subject: [PATCH] =?UTF-8?q?Prefix=20playlist=20formats=20with=20'=E2=89=A4?= =?UTF-8?q?'=20and=20read=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Format table: when in playlist mode and the format has a video codec, prefix the quality and (when available) resolution with "≤ " to indicate an upper-bound. Resolution is only prefixed if it's not "N/A". Main UI: replace the old checkbox-list lookup with scanning the format_table rows to find the checked checkbox widget, pick the correct resolution column depending on playlist mode, strip any leading "≤ " and use that as the selected resolution. This fixes resolution selection for playlist entries and ensures the displayed "≤" semantics are handled when extracting values. --- ytsage/gui/ytsage_gui_format_table.py | 6 ++++++ ytsage/gui/ytsage_gui_main.py | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ytsage/gui/ytsage_gui_format_table.py b/ytsage/gui/ytsage_gui_format_table.py index f0133ce..e87c685 100644 --- a/ytsage/gui/ytsage_gui_format_table.py +++ b/ytsage/gui/ytsage_gui_format_table.py @@ -307,6 +307,9 @@ class FormatTableMixin: # Quality label with color coding quality_label = self.get_quality_label(f) + if is_playlist_mode and f.get("vcodec") != "none": + quality_label = f"≤ {quality_label}" + quality_item = QTableWidgetItem(quality_label) # Set color based on quality (check multiple language terms) quality_lower = quality_label.lower() @@ -324,6 +327,9 @@ class FormatTableMixin: resolution = f.get("resolution") or "N/A" if not isinstance(resolution, str): resolution = str(resolution) + + if is_playlist_mode and f.get("vcodec") != "none" and resolution != "N/A": + resolution = f"≤ {resolution}" if is_playlist_mode: # Column 2 for playlist mode: Resolution diff --git a/ytsage/gui/ytsage_gui_main.py b/ytsage/gui/ytsage_gui_main.py index 880a095..f6a9331 100644 --- a/ytsage/gui/ytsage_gui_main.py +++ b/ytsage/gui/ytsage_gui_main.py @@ -713,12 +713,19 @@ class YTSageApp(QMainWindow, FormatTableMixin, VideoInfoMixin, AnalysisMixin): # Get resolution for filename resolution = "default" - for checkbox in self.format_checkboxes: - if checkbox.isChecked(): - parts = checkbox.text().split("•") - if len(parts) >= 1: - resolution = parts[0].strip().lower() - break + for row in range(self.format_table.rowCount()): + cell_widget = self.format_table.cellWidget(row, 0) + if cell_widget: + cb = cell_widget.layout().itemAt(0).widget() + if isinstance(cb, QCheckBox) and cb.isChecked(): + if self.is_playlist: + res_item = self.format_table.item(row, 2) + else: + res_item = self.format_table.item(row, 3) + + if res_item and res_item.text() != "N/A": + resolution = res_item.text().replace("≤ ", "").strip() + break # Get subtitle selection if available - Now get the list selected_subs = self.selected_subtitles if hasattr(self, "selected_subtitles") else []