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)
* 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)
* perf(server): check shared link asset access without scanning the album
checkSharedLinkAccess runs on every thumbnail, preview, playback and asset
info request made through a shared link. It joined every asset of the
link's album and only then filtered on an array overlap across four
outer-joined columns, so each request cost O(album size).
Split it into two branches (link assets, album assets) that find the
requested ids through the asset pkey / livePhotoVideoId index and then
probe the album_asset pkey.
Median per request, PG 14, 1.36M-asset instance:
| album behind the link | before | after |
|-----------------------|--------|---------|
| 290 assets | 2.1 ms | 0.17 ms |
| 150k assets | 296 ms | 0.19 ms |
* chore: clean up
---------
Co-authored-by: Jason Rasmussen <jason@rasm.me>
(cherry picked from commit bb024c862609c9e2baffc08fef795cfa3418df16)
fix: include unamed people in otherPeople (#32237)
(cherry picked from commit 9971dade1b2db76a5a79d287eb2d725152cb0323)
Co-authored-by: Jason Rasmussen <jason@rasm.me>
fix: include partner shared assets for people even without showInTimeline (#32219)
(cherry picked from commit 5fa7789e2672350c76b9b026f2b8c2bc3ffdf7c4)
Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
fix(server): don't select an audio stream ffprobe could not identify (#30901)
iPhone videos recorded with Apple Spatial Audio carry two audio tracks: an
AAC track and an APAC track that ffmpeg has no decoder for. Both are marked
default, so `compareStreams` ties on disposition and falls through to
bitrate, where the APAC track wins because spatial audio is encoded at a
higher rate. `audioStreams[0]` is then persisted and mapped into the
transcode command, and ffmpeg fails before it starts encoding:
[aist#0:2/none] Decoding requested, but no decoder found for: none
Error opening output file .../out.mp4
Error opening output files: Invalid argument
Drop audio streams ffprobe reported as `unknown` before the existing
disposition/bitrate ordering runs. A stream with no codec to decode is not a
usable audio stream, so an asset whose every audio track is unidentified is
treated as having no audio at all. The video pipeline is unchanged, since the
evidence here covers audio selection only.
(cherry picked from commit 69f06a29ca67613355348172480054ebd7e09f6c)
Co-authored-by: Lin, Chiang-Yu <110763842+RxChi1d@users.noreply.github.com>
Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
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): dont queue unneeded jobs when no xmp file exists (#31927)
(cherry picked from commit 32e3239ba32f3f89b1b0b996c103333927b3324a)
Co-authored-by: Jonathan Jogenfors <jonathan@jogenfors.se>
fix(server): make "limit" paramter use z.coerce (#31899)
(cherry picked from commit c9a3248d714cb6e6f9aff068355c5a3611c3ba64)
Co-authored-by: aviv926 <51673860+aviv926@users.noreply.github.com>
feat: auto-sync name changes to connected users (#31923)
* feat: auto-sync name changes to connected users
* fix: rename to faceId
* fix: pr feedback
* fix: mobile build
(cherry picked from commit aec7c0d97bd6679b2b300e72e870b83c5ef13c85)
Co-authored-by: Jason Rasmussen <jason@rasm.me>
feat(server): create all for owner (#31924)
(cherry picked from commit f77847dda0a72f138653b980a52ed9307372e02a)
Co-authored-by: Jason Rasmussen <jason@rasm.me>
fix(server): person birthdate timezone bug (#31901)
(cherry picked from commit 4b1b1f8c2ab70db165088d857906420b967a9241)
Co-authored-by: Jason Rasmussen <jason@rasm.me>