@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
<p align="center" width="100%">
|
<p align="center" width="100%">
|
||||||
<a href="https://hub.docker.com/r/alangrainger/immich-public-proxy/tags">
|
<a href="https://hub.docker.com/r/alangrainger/immich-public-proxy/tags">
|
||||||
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.7.2&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
|
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.7.3&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
|
||||||
<a href="https://github.com/alangrainger/immich-public-proxy/releases/latest">
|
<a href="https://github.com/alangrainger/immich-public-proxy/releases/latest">
|
||||||
<img alt="Latest release" src="https://badgen.net/static/release/v1.7.2/blue?scale=1.1"></a>
|
<img alt="Latest release" src="https://badgen.net/static/release/v1.7.3/blue?scale=1.1"></a>
|
||||||
<a href="https://immich-demo.note.sx/share/gJfs8l4LcJJrBUpjhMnDoKXFt1Tm5vKXPbXl8BgwPtLtEBCOOObqbQdV5i0oun5hZjQ"><img alt="Open demo gallery" src="https://badgen.net/static/↗🖼️/live%20demo/green?scale=1.1"></a>
|
<a href="https://immich-demo.note.sx/share/gJfs8l4LcJJrBUpjhMnDoKXFt1Tm5vKXPbXl8BgwPtLtEBCOOObqbQdV5i0oun5hZjQ"><img alt="Open demo gallery" src="https://badgen.net/static/↗🖼️/live%20demo/green?scale=1.1"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.7.2",
|
"version": "1.7.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.7.2",
|
"version": "1.7.3",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.7.2",
|
"version": "1.7.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"build": "npx tsc",
|
"build": "npx tsc",
|
||||||
|
|||||||
+7
-2
@@ -140,7 +140,7 @@ class Render {
|
|||||||
res.setHeader('Content-Type', 'application/zip')
|
res.setHeader('Content-Type', 'application/zip')
|
||||||
const title = this.title(share).replace(/[^\w .-]/g, '') + '.zip'
|
const title = this.title(share).replace(/[^\w .-]/g, '') + '.zip'
|
||||||
res.setHeader('Content-Disposition', `attachment; filename="${title}"`)
|
res.setHeader('Content-Disposition', `attachment; filename="${title}"`)
|
||||||
const archive = archiver('zip', { zlib: { level: 9 } })
|
const archive = archiver('zip', { zlib: { level: 6 } })
|
||||||
archive.pipe(res)
|
archive.pipe(res)
|
||||||
for (const asset of share.assets) {
|
for (const asset of share.assets) {
|
||||||
const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + '/original', {
|
const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + '/original', {
|
||||||
@@ -148,10 +148,15 @@ class Render {
|
|||||||
password: asset.password
|
password: asset.password
|
||||||
})
|
})
|
||||||
const data = await fetch(url)
|
const data = await fetch(url)
|
||||||
|
// Check the response for validity
|
||||||
|
if (!data.ok) {
|
||||||
|
console.warn(`Failed to fetch asset: ${asset.id}`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
archive.append(Buffer.from(await data.arrayBuffer()), { name: asset.originalFileName || asset.id })
|
archive.append(Buffer.from(await data.arrayBuffer()), { name: asset.originalFileName || asset.id })
|
||||||
}
|
}
|
||||||
await archive.finalize()
|
await archive.finalize()
|
||||||
res.end()
|
archive.on('end', () => res.end())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user