From 148facef6cdc33e929ff3768bff1ca1ef6a051d7 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:55:50 +0800 Subject: [PATCH] #152 Fix issue with missing file extension in zip download --- app/package.json | 2 +- app/src/render.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/package.json b/app/package.json index 9f8b911..611ed35 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.14.0", + "version": "1.14.1", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/render.ts b/app/src/render.ts index 2ccef58..e2d05b4 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -202,16 +202,17 @@ class Render { * Generate a filename for the downloaded asset based on the configuration option chosen */ getFilename (asset: Asset) { + const extension = asset.originalFileName?.match(/(\.\w+)$/)?.[1] || '' switch (getConfigOption('ipp.downloadedFilename')) { case 1: // Immich's ID number for this asset - return asset.id + return asset.id + extension case 2: // A sanitised version of the ID number - return 'img_' + asset.id.slice(0, 8) + return 'img_' + asset.id.slice(0, 8) + extension default: // By default, it will choose the asset's original filename - return asset.originalFileName || asset.id + return asset.originalFileName || (asset.id + extension) } } }