diff --git a/src/photo/index.ts b/src/photo/index.ts index c5aed240..a03b81ba 100644 --- a/src/photo/index.ts +++ b/src/photo/index.ts @@ -222,7 +222,7 @@ export const dateRangeForPhotos = ( }; export const photoHasCameraData = (photo: Photo) => - photo.make || + photo.make && photo.model; export const photoHasExifData = (photo: Photo) => diff --git a/src/services/vercel-postgres.ts b/src/services/vercel-postgres.ts index d3af54aa..c16bfee0 100644 --- a/src/services/vercel-postgres.ts +++ b/src/services/vercel-postgres.ts @@ -242,6 +242,8 @@ const sqlGetUniqueCameras = async () => sql` SELECT DISTINCT make||' '||model as camera, make, model, COUNT(*) FROM photos WHERE hidden IS NOT TRUE + AND make IS NOT NULL + AND model IS NOT NULL GROUP BY make, model ORDER BY camera ASC `.then(({ rows }): Cameras => rows.map(({ make, model, count }) => ({