#152 Fix issue with missing file extension in zip download
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.14.0",
|
"version": "1.14.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"build": "npx tsc",
|
"build": "npx tsc",
|
||||||
|
|||||||
+4
-3
@@ -202,16 +202,17 @@ class Render {
|
|||||||
* Generate a filename for the downloaded asset based on the configuration option chosen
|
* Generate a filename for the downloaded asset based on the configuration option chosen
|
||||||
*/
|
*/
|
||||||
getFilename (asset: Asset) {
|
getFilename (asset: Asset) {
|
||||||
|
const extension = asset.originalFileName?.match(/(\.\w+)$/)?.[1] || ''
|
||||||
switch (getConfigOption('ipp.downloadedFilename')) {
|
switch (getConfigOption('ipp.downloadedFilename')) {
|
||||||
case 1:
|
case 1:
|
||||||
// Immich's ID number for this asset
|
// Immich's ID number for this asset
|
||||||
return asset.id
|
return asset.id + extension
|
||||||
case 2:
|
case 2:
|
||||||
// A sanitised version of the ID number
|
// A sanitised version of the ID number
|
||||||
return 'img_' + asset.id.slice(0, 8)
|
return 'img_' + asset.id.slice(0, 8) + extension
|
||||||
default:
|
default:
|
||||||
// By default, it will choose the asset's original filename
|
// By default, it will choose the asset's original filename
|
||||||
return asset.originalFileName || asset.id
|
return asset.originalFileName || (asset.id + extension)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user