This commit is contained in:
2026-01-14 15:03:08 -08:00
parent 25c940351a
commit 0f726b11dc
2 changed files with 26 additions and 8 deletions

View File

@@ -242,11 +242,18 @@ class ZeroTier(Store):
# CLI prefers 'path' and 'size_bytes'
if "file_path" in f and "path" not in f:
f["path"] = f["file_path"]
if "title" not in f:
# Try to extract title from tags
tags = f.get("tag") or []
title_tag = next((t for t in tags if str(t).lower().startswith("title:")), None)
if title_tag and ":" in title_tag:
f["title"] = title_tag.split(":", 1)[1].strip()
elif "title" not in f:
try:
f["title"] = Path(f["file_path"]).stem
except Exception:
f["title"] = f["file_path"]
if "size" in f and "size_bytes" not in f:
f["size_bytes"] = f["size"]
return files
@@ -364,6 +371,11 @@ class ZeroTier(Store):
res = self._request_remote("GET", f"/files/{file_hash}")
if isinstance(res, dict):
# Extract title from tags for the details panel/metadata view
tags = res.get("tag") or []
title_tag = next((t for t in tags if str(t).lower().startswith("title:")), None)
if title_tag and ":" in title_tag:
res["title"] = title_tag.split(":", 1)[1].strip()
return res
return None