8eadd1f408f55720366b1beb995159ac155f0375
The bulk-download handler still returned 500 after the membership fix. Three issues: 1. Repeat downloads were broken: the handler passed priorUsages[0].id (the usage id) straight as downloadId, but claimAuthorized looks up download_events.id (the intent id) — so repeat assets never matched and were silently skipped. Now calls createRepeatDownload to mint a proper repeat intent, matching the single-download flow. 2. The catch block returned a generic 500 for every error, hiding the cause (the user only saw "Download fehlgeschlagen"). Added mappedBulkError so UsageAccountingError surfaces as its real code (503 IMMICH_UNAVAILABLE, 404 ASSET_NOT_IN_ALBUM, …) and the server log keeps the full stack. 3. The assetId→album map was built by fetching up to 1000 assets per granted album WITH withExif, then createNewUsage re-fetched per asset — heavy enough to time Immich out under load. The map only needs ids, so it now passes withExif:false (searchPhotos gained a withExif option, default true to preserve the gallery's orientation filter and masonry aspect ratios). Co-Authored-By: Claude <noreply@anthropic.com>
Languages
TypeScript
98.4%
CSS
1.3%
Shell
0.2%
Dockerfile
0.1%