This commit is contained in:
2026-01-11 14:46:41 -08:00
parent 1f3de7db1c
commit 275f18cb31
19 changed files with 2741 additions and 394 deletions

22
CLI.py
View File

@@ -2234,7 +2234,7 @@ class PipelineExecutor:
# Prefer an explicit provider hint from table metadata when available.
# This keeps @N selectors working even when row payloads don't carry a
# provider key (or when they carry a table-type like hifi.album).
# provider key (or when they carry a table-type like tidal.album).
try:
meta = (
current_table.get_table_metadata()
@@ -2264,7 +2264,7 @@ class PipelineExecutor:
get_provider = None # type: ignore
is_known_provider_name = None # type: ignore
# If we have a table-type like "hifi.album", also try its provider prefix ("hifi")
# If we have a table-type like "tidal.album", also try its provider prefix ("tidal")
# when that prefix is a registered provider name.
if is_known_provider_name is not None:
try:
@@ -2498,7 +2498,7 @@ class PipelineExecutor:
# Selection should operate on the *currently displayed* selectable table.
# Some navigation flows (e.g. @.. back) can show a display table without
# updating current_stage_table. Provider selectors rely on current_stage_table
# to detect table type (e.g. hifi.album -> tracks), so sync it here.
# to detect table type (e.g. tidal.album -> tracks), so sync it here.
display_table = None
try:
display_table = (
@@ -2722,7 +2722,7 @@ class PipelineExecutor:
return False, None
# Provider selection expansion (non-terminal): allow certain provider tables
# (e.g. hifi.album) to expand to multiple downstream items when the user
# (e.g. tidal.album) to expand to multiple downstream items when the user
# pipes into another stage (e.g. @N | .mpv or @N | add-file).
table_type_hint = None
try:
@@ -2734,11 +2734,11 @@ class PipelineExecutor:
except Exception:
table_type_hint = None
if stages and isinstance(table_type_hint, str) and table_type_hint.strip().lower() == "hifi.album":
if stages and isinstance(table_type_hint, str) and table_type_hint.strip().lower() == "tidal.album":
try:
from ProviderCore.registry import get_provider
prov = get_provider("hifi", config)
prov = get_provider("tidal", config)
except Exception:
prov = None
@@ -2780,7 +2780,7 @@ class PipelineExecutor:
if track_items:
filtered = track_items
table_type_hint = "hifi.track"
table_type_hint = "tidal.track"
if PipelineExecutor._maybe_run_class_selector(
ctx,
@@ -2891,7 +2891,7 @@ class PipelineExecutor:
# (e.g., @1 | add-file ...), we want to attach the row selection
# args *to the auto-inserted stage* so the download command receives
# the selected row information immediately.
stages.append(list(auto_stage) + (source_args or []))
stages.append(list(auto_stage))
debug(f"Inserted auto stage before row action: {stages[-1]}")
# If the caller included a selection (e.g., @1) try to attach
@@ -2940,7 +2940,9 @@ class PipelineExecutor:
if first_cmd_norm not in (auto_cmd_norm, ".pipe", ".mpv"):
debug(f"Auto-inserting {auto_cmd_norm} after selection")
# Insert the auto stage before the user-specified stage
stages.insert(0, list(auto_stage) + (source_args or []))
# Note: Do NOT append source_args here - they are search tokens from
# the previous stage and should not be passed to the downloader.
stages.insert(0, list(auto_stage))
debug(f"Inserted auto stage before existing pipeline: {stages[0]}")
# If a selection is present, attach the row selection args to the
@@ -3278,7 +3280,7 @@ class PipelineExecutor:
stage_table = ctx.get_current_stage_table()
# Selection should operate on the table the user sees.
# If a display overlay table exists, force it as the current-stage table
# so provider selectors (e.g. hifi.album -> tracks) behave consistently.
# so provider selectors (e.g. tidal.album -> tracks) behave consistently.
try:
if display_table is not None and hasattr(ctx, "set_current_stage_table"):
ctx.set_current_stage_table(display_table)