#196 Fix incorrect original download in zip

This commit is contained in:
Alan Grainger
2026-03-03 10:24:18 +13:00
parent ec283b4bd9
commit 8eb99a265a
+5 -2
View File
@@ -185,6 +185,7 @@ class Render {
* Download all assets as a zip file * Download all assets as a zip file
*/ */
async downloadAll (res: Response, share: SharedLink) { async downloadAll (res: Response, share: SharedLink) {
const downloadOriginalAsset = getConfigOption('ipp.downloadOriginalPhoto', true)
res.setHeader('Content-Type', 'application/zip') res.setHeader('Content-Type', 'application/zip')
let filename = (sanitize(this.title(share)) || 'photos') + '.zip' let filename = (sanitize(this.title(share)) || 'photos') + '.zip'
filename = encodeURI(filename) filename = encodeURI(filename)
@@ -192,9 +193,11 @@ class Render {
const archive = archiver('zip', { zlib: { level: 6 } }) const archive = archiver('zip', { zlib: { level: 6 } })
archive.pipe(res) archive.pipe(res)
await Promise.all(share.assets.map(async (asset) => { await Promise.all(share.assets.map(async (asset) => {
const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + '/original', { const endpoint = downloadOriginalAsset ? 'original' : 'thumbnail'
const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + '/' + endpoint, {
key: asset.key, key: asset.key,
password: asset.password password: asset.password,
size: downloadOriginalAsset ? '' : 'preview'
}) })
const data = await fetch(url) const data = await fetch(url)
// Check the response for validity // Check the response for validity