This commit is contained in:
2026-02-07 14:58:13 -08:00
parent c8230cbb42
commit 60c2cc062c
9 changed files with 69 additions and 78 deletions

View File

@@ -971,8 +971,18 @@ class search_file(Cmdlet):
p_str = str(p_val or "").strip()
if p_str:
if p_str.startswith(("http://", "https://", "magnet:", "torrent:")):
sel_args = ["-url", p_str]
sel_action = ["download-file", "-url", p_str]
h = normalized.get("hash") or normalized.get("file_hash") or normalized.get("hash_hex")
s_val = normalized.get("store")
if h and s_val and "/view_file" in p_str:
try:
h_norm = normalize_hash(h)
except Exception:
h_norm = str(h)
sel_args = ["-query", f"hash:{h_norm}", "-store", str(s_val)]
sel_action = ["get-metadata", "-query", f"hash:{h_norm}", "-store", str(s_val)]
else:
sel_args = ["-url", p_str]
sel_action = ["download-file", "-url", p_str]
else:
try:
from SYS.utils import expand_path