feat: add paged NAS photo browser with metadata filters and previews
Community checks / verify (push) Skipped
Verify Frame Flow / verify (push) Failing after 7m29s

This commit is contained in:
渡口浪人
2026-10-23 19:59:02 +08:00
parent 8ce4aafb93
commit 6ebc5e7afb
14 changed files with 579 additions and 25 deletions
@@ -337,12 +337,14 @@ class SynologyPhotos:
self.cache[key] = (time.monotonic(), names)
return list(self.cache[key][1].get(str(item_id), []))
def download(self, row, *, space="shared", rendition="thumbnail"):
def download(self, row, *, space="shared", rendition="thumbnail", size="xl"):
from pigway_frame_flow.providers.photos_cache import PhotosCache
sid = self.sid()
url, pin = self.endpoint()
prefix = "SYNO.FotoTeam" if space == "shared" else "SYNO.Foto"
if size not in ("m", "xl"):
raise FlowError(E.INVALID_REQUEST, "Invalid Photos preview size")
if rendition == "thumbnail":
thumb = row.get("additional", {}).get("thumbnail", {})
if not thumb.get("cache_key") or not thumb.get("unit_id"):
@@ -353,7 +355,7 @@ class SynologyPhotos:
params = dict(
id=thumb["unit_id"],
cache_key=thumb["cache_key"],
size="xl",
size=size,
type="unit",
)
else:
@@ -372,6 +374,7 @@ class SynologyPhotos:
space,
row["id"],
rendition,
size,
row.get("indexed_time"),
row.get("filesize"),
row.get("additional", {}).get("thumbnail", {}).get("cache_key"),