1.3 KiB
1.3 KiB
Debug Photos Display
This directory contains tools to debug why photos aren't appearing on the photos page.
API Test Endpoint
Visit the following URL in your browser while the dev server is running:
http://localhost:5173/api/test-photos
This endpoint will return detailed information about:
- All photos with showInPhotos=true and albumId=null
- Status distribution of these photos
- Raw SQL query results
- Comparison with what the /api/photos endpoint expects
Database Query Script
Run the following command to query the database directly:
npx tsx scripts/test-photos-query.ts
This script will show:
- Total photos in the database
- Photos matching the criteria (showInPhotos=true, albumId=null)
- Status distribution
- Published vs draft photos
- All unique status values in the database
What to Check
- Status Values: The main photos API expects
status='published'. Check if your photos have this status. - showInPhotos Flag: Make sure photos have
showInPhotos=true - Album Association: Photos should have
albumId=nullto appear as individual photos
Common Issues
- Photos might be in 'draft' status instead of 'published'
- Photos might have showInPhotos=false
- Photos might be associated with an album (albumId is not null)