fix(maps): marker thumbs from cached place photos load under the same request limit

A place whose image_url already is the place-photo proxy URL skipped the five
slot limiter and loaded its marker picture right away. A map showing a big
list, such as "All saved" in collections, asked for every picture at once.
Those downloads now wait for a slot like the provider lookups do; the entry
itself is still there immediately.

Refs #2559
This commit is contained in:
Maurice
2026-10-12 12:59:45 +02:00
parent 8acc035efa
commit 106b748551
2 changed files with 44 additions and 5 deletions
+9 -4
View File
@@ -114,10 +114,15 @@ export function fetchPhoto(
cache.set(cacheKey, entry)
callback?.(entry)
notify(cacheKey, entry)
// Generate base64 thumb in background
void urlToBase64(photoId).then(thumb => {
if (thumb) { entry.thumbDataUrl = thumb; notifyThumb(cacheKey, thumb) }
})
// Generate base64 thumb in background, under the same limit as the API path:
// a list of a thousand saved places would otherwise ask for a thousand
// pictures at once (#2559).
void acquireRequestSlot()
.then(() => urlToBase64(photoId))
.then(thumb => {
if (thumb) { entry.thumbDataUrl = thumb; notifyThumb(cacheKey, thumb) }
})
.finally(releaseRequestSlot)
return
}