feat: stream originals with download accounting

This commit is contained in:
Leon Tonhäuser committed 2026-08-10 13:10:13 +02:00
1 parent c400167b8f
commit 8871e4794a
28 files changed
+4081 -8

No files matched your search

+7 -1
View File
@@ -3,6 +3,7 @@ import { notFound } from "next/navigation";
import { AlbumCatalogError, albumCatalog } from "@/modules/albums/catalog";
import { PhotoContactSheet } from "@/modules/albums/catalog-content";
import { loadEditorialDownloadOptions } from "@/modules/downloads/stream";
import { requireEditorial } from "../../access";
@@ -44,6 +45,7 @@ export default async function AlbumPage({ params, searchParams }: AlbumPageProps
<PhotoContactSheet
albumId={result.album.id}
albumName={result.album.albumName}
downloadOptions={result.downloadOptions}
page={result.page}
query={query}
/>
@@ -73,7 +75,11 @@ async function loadAlbumPage({
description: query,
page,
});
return { album, page: results, unavailable: false as const };
const downloadOptions = await loadEditorialDownloadOptions(
editorialId,
results.items.map((asset) => asset.id),
);
return { album, page: results, downloadOptions, unavailable: false as const };
} catch (error) {
if (error instanceof AlbumCatalogError && error.code === "IMMICH_UNAVAILABLE") {
return { album: null, page: null, unavailable: true as const };