Co-authored-by: Jason Rasmussen <jason@rasm.me>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
(cherry picked from commit 72e2bc8b0bc4a7e0a84ac16c0bde7f5e538729fb)
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 |
(cherry picked from commit ac453b5557e42ad45962d3079a4e4450671053e9)
fix(server): include album owner for album shared links (#31837)
(cherry picked from commit fd97f3e5a62a4af1a8e17d2e766eb952eefae24a)
Co-authored-by: Mees Frensel <33722705+meesfrensel@users.noreply.github.com>
* fix(server): prevent album shared link from breaking after uploads
* update test
* add withSharedAssets helper
* remove options
* add more helpers
* update selects