feat: add paged NAS photo browser with metadata filters and previews
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user