From 2f9d7adf4ac9a63c217f50e30b539c039cce003e Mon Sep 17 00:00:00 2001 From: jubnl Date: Tue, 21 Apr 2026 13:43:15 +0200 Subject: [PATCH] fix: PDF thumbnails missing for MCP-added places (osm_id) fetchPlacePhotos only checked google_place_id, skipping places that only have osm_id (e.g. those added via MCP). Mirror PlaceAvatar logic by falling back to osm_id in both the filter and the photo fetch call. --- client/src/components/PDF/TripPDF.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/PDF/TripPDF.tsx b/client/src/components/PDF/TripPDF.tsx index e02939e5..4657fbce 100644 --- a/client/src/components/PDF/TripPDF.tsx +++ b/client/src/components/PDF/TripPDF.tsx @@ -96,12 +96,12 @@ async function fetchPlacePhotos(assignments) { const allPlaces = Object.values(assignments).flatMap(a => a.map(x => x.place)).filter(Boolean) const unique = [...new Map(allPlaces.map(p => [p.id, p])).values()] - const toFetch = unique.filter(p => !p.image_url && p.google_place_id) + const toFetch = unique.filter(p => !p.image_url && (p.google_place_id || p.osm_id)) await Promise.allSettled( toFetch.map(async (place) => { try { - const data = await mapsApi.placePhoto(place.google_place_id) + const data = await mapsApi.placePhoto(place.google_place_id || place.osm_id) if (data.photoUrl) photoMap[place.id] = data.photoUrl } catch {} })