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.
This commit is contained in:
jubnl
2026-04-21 13:43:15 +02:00
parent ee14f706c8
commit 2f9d7adf4a
+2 -2
View File
@@ -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 {}
})