f
This commit is contained in:
@@ -66,8 +66,8 @@ class search_file(Cmdlet):
|
||||
CmdletArg(
|
||||
"provider",
|
||||
type="string",
|
||||
description=
|
||||
"External provider name: bandcamp, libgen, soulseek, youtube, alldebrid, loc, internetarchive, hifi",
|
||||
description="External provider name (e.g., tidal, youtube, soulseek, etc)",
|
||||
choices=["bandcamp", "libgen", "soulseek", "youtube", "alldebrid", "loc", "internetarchive", "tidal", "tidal"],
|
||||
),
|
||||
CmdletArg(
|
||||
"open",
|
||||
@@ -116,7 +116,7 @@ class search_file(Cmdlet):
|
||||
return ext[:5]
|
||||
|
||||
@staticmethod
|
||||
def _get_hifi_view_from_query(query: str) -> str:
|
||||
def _get_tidal_view_from_query(query: str) -> str:
|
||||
text = str(query or "").strip()
|
||||
if not text:
|
||||
return "track"
|
||||
@@ -303,10 +303,10 @@ class search_file(Cmdlet):
|
||||
preserve_order = provider_lower in {"youtube", "openlibrary", "loc", "torrent"}
|
||||
table_type = provider_name
|
||||
table_meta: Dict[str, Any] = {"provider": provider_name}
|
||||
if provider_lower == "hifi":
|
||||
view = self._get_hifi_view_from_query(query)
|
||||
if provider_lower == "tidal":
|
||||
view = self._get_tidal_view_from_query(query)
|
||||
table_meta["view"] = view
|
||||
table_type = f"hifi.{view}"
|
||||
table_type = f"tidal.{view}"
|
||||
elif provider_lower == "internetarchive":
|
||||
# Internet Archive search results are effectively folders (items); selecting @N
|
||||
# should open a list of downloadable files for the chosen item.
|
||||
@@ -339,10 +339,10 @@ class search_file(Cmdlet):
|
||||
results = provider.search(query, limit=limit, filters=search_filters or None)
|
||||
debug(f"[search-file] {provider_name} -> {len(results or [])} result(s)")
|
||||
|
||||
# HIFI artist UX: if there is exactly one artist match, auto-expand
|
||||
# Tidal artist UX: if there is exactly one artist match, auto-expand
|
||||
# directly to albums without requiring an explicit @1 selection.
|
||||
if (
|
||||
provider_lower == "hifi"
|
||||
provider_lower == "tidal"
|
||||
and table_meta.get("view") == "artist"
|
||||
and isinstance(results, list)
|
||||
and len(results) == 1
|
||||
@@ -372,7 +372,7 @@ class search_file(Cmdlet):
|
||||
|
||||
if album_results:
|
||||
results = album_results
|
||||
table_type = "hifi.album"
|
||||
table_type = "tidal.album"
|
||||
table.set_table(table_type)
|
||||
table_meta["view"] = "album"
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user