From e9063d3a717f7c9945c0ac1fd28fe0c7705771d0 Mon Sep 17 00:00:00 2001 From: ralksta Date: Fri, 29 May 2026 17:04:57 +0200 Subject: [PATCH] feat: add video streaming proxy and webhook cache invalidation - Add /api/video/[id] route with Range header support for seeking - Add /api/webhook route for Immich event-driven cache invalidation - Add streamVideo() to ImmichClient with 206 Partial Content support - Support album description overrides in gallery.yaml - Add videoUrl() helper to lib/urls.ts - Export cache.delete() and cache.clear() methods --- app/api/video/[id]/route.ts | 66 +++++++++++++++++++++++ app/api/webhook/route.ts | 102 +++++++++++++++++++++++++++++++++++ content/gallery.yaml.example | 1 + lib/cache.ts | 4 ++ lib/config/schema.ts | 23 ++++++-- lib/immich.ts | 69 ++++++++++++++++++++++++ lib/urls.ts | 7 +++ 7 files changed, 267 insertions(+), 5 deletions(-) create mode 100644 app/api/video/[id]/route.ts create mode 100644 app/api/webhook/route.ts diff --git a/app/api/video/[id]/route.ts b/app/api/video/[id]/route.ts new file mode 100644 index 0000000..c258ba6 --- /dev/null +++ b/app/api/video/[id]/route.ts @@ -0,0 +1,66 @@ +/** + * Video proxy route — streams Immich video assets to the browser + * without exposing the Immich server or API key. + * + * Supports HTTP Range requests (required for