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).
Immich v2.6 changed the API response for password-protected shared links
from "Invalid password" to "Password required" when no password token is
provided. The previous string match on the message caused the proxy to
fall through to the catch-all and return 404 instead of showing the
password entry page.
Match on the 401 status code alone, since this endpoint only returns 401
for password-related reasons. This is backwards compatible with older
Immich versions and resilient to future message wording changes.
Fixes#198
Made-with: Cursor
Direct asset URLs (/share/photo/:key/:id and /share/video/:key/:id)
were bypassing password protection. This fix:
- Validates the share link via getShareByKey() before serving
- Redirects to share page if password is required but not provided
- Verifies the requested asset belongs to the share link
Fixes#173
When loading the assets in the album, we do so sequentially which is not ideal, particularly on larger albums. This PR loads all assets in parallel instead.