Prefix playlist formats with '≤' and read table
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.
This commit is contained in:
@@ -307,6 +307,9 @@ class FormatTableMixin:
|
|||||||
|
|
||||||
# Quality label with color coding
|
# Quality label with color coding
|
||||||
quality_label = self.get_quality_label(f)
|
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)
|
quality_item = QTableWidgetItem(quality_label)
|
||||||
# Set color based on quality (check multiple language terms)
|
# Set color based on quality (check multiple language terms)
|
||||||
quality_lower = quality_label.lower()
|
quality_lower = quality_label.lower()
|
||||||
@@ -324,6 +327,9 @@ class FormatTableMixin:
|
|||||||
resolution = f.get("resolution") or "N/A"
|
resolution = f.get("resolution") or "N/A"
|
||||||
if not isinstance(resolution, str):
|
if not isinstance(resolution, str):
|
||||||
resolution = str(resolution)
|
resolution = str(resolution)
|
||||||
|
|
||||||
|
if is_playlist_mode and f.get("vcodec") != "none" and resolution != "N/A":
|
||||||
|
resolution = f"≤ {resolution}"
|
||||||
|
|
||||||
if is_playlist_mode:
|
if is_playlist_mode:
|
||||||
# Column 2 for playlist mode: Resolution
|
# Column 2 for playlist mode: Resolution
|
||||||
|
|||||||
@@ -713,12 +713,19 @@ class YTSageApp(QMainWindow, FormatTableMixin, VideoInfoMixin, AnalysisMixin):
|
|||||||
|
|
||||||
# Get resolution for filename
|
# Get resolution for filename
|
||||||
resolution = "default"
|
resolution = "default"
|
||||||
for checkbox in self.format_checkboxes:
|
for row in range(self.format_table.rowCount()):
|
||||||
if checkbox.isChecked():
|
cell_widget = self.format_table.cellWidget(row, 0)
|
||||||
parts = checkbox.text().split("•")
|
if cell_widget:
|
||||||
if len(parts) >= 1:
|
cb = cell_widget.layout().itemAt(0).widget()
|
||||||
resolution = parts[0].strip().lower()
|
if isinstance(cb, QCheckBox) and cb.isChecked():
|
||||||
break
|
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
|
# Get subtitle selection if available - Now get the list
|
||||||
selected_subs = self.selected_subtitles if hasattr(self, "selected_subtitles") else []
|
selected_subs = self.selected_subtitles if hasattr(self, "selected_subtitles") else []
|
||||||
|
|||||||
Reference in New Issue
Block a user