diff --git a/src/components/assets/missing-location/MissingLocationAssets.tsx b/src/components/assets/missing-location/MissingLocationAssets.tsx index f2a4ee6..2971187 100644 --- a/src/components/assets/missing-location/MissingLocationAssets.tsx +++ b/src/components/assets/missing-location/MissingLocationAssets.tsx @@ -61,7 +61,7 @@ export default function MissingLocationAssets() { ), }, ], - })).filter((p) => !p.original); + })); }, [assets, selectedIds]); const slides = useMemo( diff --git a/src/pages/api/albums/[id]/info.ts b/src/pages/api/albums/[id]/info.ts index de77925..a84c6fd 100644 --- a/src/pages/api/albums/[id]/info.ts +++ b/src/pages/api/albums/[id]/info.ts @@ -21,7 +21,7 @@ export default async function handler( } const { id } = req.query as { id: string }; - const dbAlbums = await db.selectDistinctOn([assets.id], { + const dbAlbums = await db.selectDistinctOn([albums.id], { id: albums.id, albumName: albums.albumName, createdAt: albums.createdAt, @@ -35,7 +35,7 @@ export default async function handler( .from(albums) .leftJoin(albumsAssetsAssets, eq(albums.id, albumsAssetsAssets.albumsId)) .leftJoin(assets, eq(albumsAssetsAssets.assetsId, assets.id)) - .leftJoin(exif, eq(assets.id, exif.assetId)) + .leftJoin(exif, and(eq(assets.id, exif.assetId), eq(assets.isVisible, true))) .leftJoin(assetFaces, eq(assets.id, assetFaces.assetId)) .leftJoin(person, and(eq(assetFaces.personId, person.id), eq(person.isHidden, false))) .where(and(eq(albums.ownerId, currentUser.id), eq(albums.id, id))) diff --git a/src/pages/api/assets/missing-location-assets.ts b/src/pages/api/assets/missing-location-assets.ts index d1e7ced..fe4934d 100644 --- a/src/pages/api/assets/missing-location-assets.ts +++ b/src/pages/api/assets/missing-location-assets.ts @@ -53,7 +53,6 @@ export default async function handler( gte(exif.dateTimeOriginal, startDateDate), lte(exif.dateTimeOriginal, endDateDate), eq(assets.ownerId, currentUser.id), - eq(assets.isVisible, true), )); return res.status(200).json(rows);