diff --git a/app/package.json b/app/package.json index d171ab0..5b7132b 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.5.0", + "version": "1.5.1", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/render.ts b/app/src/render.ts index 99ed4be..98691eb 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -53,6 +53,11 @@ class Render { }) const data = await fetch(url, { headers }) + // Add the filename for downloaded assets + if (size === ImageSize.original && asset.originalFileName && getConfigOption('ipp.downloadOriginalPhoto', true)) { + res.setHeader('Content-Disposition', `attachment; filename="${asset.originalFileName}"`) + } + // Return the response to the client if (data.status >= 200 && data.status < 300) { // Populate the whitelisted response headers @@ -97,7 +102,8 @@ class Render { controls: true } }) - } else if (asset.type === AssetType.image && getConfigOption('ipp.downloadOriginalPhoto', true)) { + } + if (getConfigOption('ipp.downloadOriginalPhoto', true)) { // Add a download link for the original-size image, if configured in config.json downloadUrl = immich.photoUrl(share.key, asset.id, ImageSize.original, asset.password) } diff --git a/app/views/gallery.ejs b/app/views/gallery.ejs index de58d33..3f8287c 100644 --- a/app/views/gallery.ejs +++ b/app/views/gallery.ejs @@ -21,7 +21,11 @@