diff --git a/src/services/dav/base.ts b/src/services/dav/base.ts index fdfa23f7..6bcc28db 100644 --- a/src/services/dav/base.ts +++ b/src/services/dav/base.ts @@ -194,10 +194,14 @@ export async function extendWithStack(photos: IPhoto[]) { } // Add stacked RAW files (deduped) - const stackRaw = Array.from(new Set(photos.map((p) => p.stackraw ?? []).flat())); + const stackRaw = photos.map((p) => p.stackraw ?? []).flat(); - // Combine and return - return photos.concat(livePhotos, stackRaw); + // Combine all files + const combined = photos.concat(livePhotos, stackRaw); + + // De-duplicate + const unique = new Map(combined.map((p) => [p.fileid, p])); + return Array.from(unique.values()); } /**