This commit is contained in:
2026-01-14 14:54:18 -08:00
parent 0c70aab725
commit 25c940351a
3 changed files with 39 additions and 7 deletions

View File

@@ -44,7 +44,8 @@ from SYS import pipeline as ctx
STORAGE_ORIGINS = {"local",
"hydrus",
"folder"}
"folder",
"zerotier"}
class search_file(Cmdlet):
@@ -887,11 +888,24 @@ class search_file(Cmdlet):
store_val = str(item_dict.get("store") or "").lower()
if store_filter != store_val:
continue
# Normalize storage results (ensure title, ext, etc.)
normalized = self._ensure_storage_columns(item_dict)
# If normalize skipped it due to STORAGE_ORIGINS, do it manually
if "title" not in normalized:
normalized["title"] = (
item_dict.get("title") or item_dict.get("name") or
item_dict.get("path") or item_dict.get("target") or "Result"
)
if "ext" not in normalized:
t = str(normalized.get("title", ""))
if "." in t:
normalized["ext"] = t.split(".")[-1].lower()[:5]
# Make hash/store available for downstream cmdlet without rerunning search
hash_val = normalized.get("hash")
store_val = normalized.get("store") or item_dict.get("store")
store_val = normalized.get("store") or item_dict.get("store") or backend_to_search
if hash_val and not normalized.get("hash"):
normalized["hash"] = hash_val
if store_val and not normalized.get("store"):