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 = 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()
|
||||
@@ -325,6 +328,9 @@ class FormatTableMixin:
|
||||
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
|
||||
self.format_table.setItem(row, 2, QTableWidgetItem(resolution))
|
||||
|
||||
@@ -713,11 +713,18 @@ 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()
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user