mirror of
https://github.com/immich-app/immich.git
synced 2026-10-14 00:49:35 +02:00
SharedLinkRepository.get (shared link page load, /shared-links/me, and the OpenGraph tags rendered for /share/:key) json_agg'd every asset of the album, with its full exif row, ordered by fileCreatedAt. The only things used from it are the asset count and the first/last localDateTime. Load the album without assets and fill assetCount/startDate/endDate from getMetadataForIds, which is what GET /albums/:id already uses. The counts now also respect the default visibility filter, and the dates are formatted the same as on /albums/:id. 150k-asset album link, PG 14: | | before | after | |------------------------|-----------------|--------| | query | 4.2-6.5 s | ~0.26 s (metadata aggregate) | | JSON built by postgres | 261 MB | - | | GET /shared-links/me | - | 0.28 s, 961 B |