Show a badge on the gallery thumbnail and a lightbox toggle that plays the
photo's clip over the still, matching Immich's own viewer.
The clip is a hidden Immich asset, but the existing share key already
authorises it - checkSharedLinkAccess whitelists each shared asset's
livePhotoVideoId - so no new upstream access is involved. The video route
accepts a clip id only when a shared still points at it.
Both enumeration paths already carry the field (AssetResponseDto for
individual shares, TimeBucketAssetResponseDto for album buckets), so album
shares cost no extra upstream requests.
Gated by ipp.motionPhotos (default true). The clip is preload="none" and is
only fetched when a visitor presses the toggle.
These optimizations both help large albums where many simultaneous downloads will overwhelm Immich. Also with larger downloads, a transient network error is more likely to happen to at least one asset, so three total attempts will be made per asset.
If download fails after retries, the entire download will be aborted. This is to avoid silent failures where users may think their download is complete when assets may actually have been dropped.
The next optimization to make will be building the archive on disk instead of loading every image into memory (will fail for very large albums).