Files
Immich/server/src/services
bo0tzz 1978b77a40 perf(server): stop loading every album asset to build album responses (#32413)
* perf(server): stop loading every album asset to build album responses

Album create, update (rename, description, cover, sort order, activity
toggle) and add-users json_agg'd every asset of the album with its exif
row, only for mapAlbum to read the count and the first/last
localDateTime. Use getMetadataForIds for those fields, as GET /albums/:id
already does, and drop the now unused withAssets option from getById.

The responses now carry the same date format and lastModifiedAssetTimestamp
as GET /albums/:id.

PATCH /albums/:id on a 150k-asset album, PG 14 (response is ~900 B either
way): 3.4-3.6 s -> 0.13-0.16 s.

* refactor(server): share album metadata mapping

(cherry picked from commit 2a4e876ec990a4a8d5fdca00291cbeebd3d1bccf)
2026-10-14 21:24:13 +03:00
..
2026-09-10 13:22:29 +02:00
2026-09-10 13:22:29 +02:00