k
This commit is contained in:
@@ -233,7 +233,23 @@ class ZeroTier(Store):
|
||||
params = {"q": query, "limit": int(kwargs.get("limit", 100))}
|
||||
res = self._request_remote("GET", "/files/search", params=params)
|
||||
if isinstance(res, dict):
|
||||
return list(res.get("files") or [])
|
||||
files = list(res.get("files") or [])
|
||||
# Inject store name and normalize keys for the CLI
|
||||
for f in files:
|
||||
if isinstance(f, dict):
|
||||
f["store"] = self._name
|
||||
# remote_storage_server returns 'file_path' and 'size'
|
||||
# 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:
|
||||
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
|
||||
return []
|
||||
|
||||
def get_file(self, file_hash: str, **kwargs: Any) -> Optional[Path | str]:
|
||||
|
||||
Reference in New Issue
Block a user