Updated logging

This commit is contained in:
Alan Grainger
2024-10-30 14:38:08 +01:00
parent 1566f7abe4
commit b191442d4b
4 changed files with 6 additions and 6 deletions
+2
View File
@@ -32,6 +32,7 @@ app.get('/share/:key', async (req, res) => {
res.status(404).send()
} else if (sharedLink.assets.length === 1) {
// This is an individual item (not a gallery)
log('Serving link ' + req.params.key)
const asset = sharedLink.assets[0]
if (asset.type === AssetType.image) {
// For photos, output the image directly
@@ -42,6 +43,7 @@ app.get('/share/:key', async (req, res) => {
}
} else {
// Multiple images - render as a gallery
log('Serving link ' + req.params.key)
await render.gallery(res, sharedLink)
}
}
-2
View File
@@ -1,7 +1,6 @@
import immich from './immich'
import { Response } from 'express-serve-static-core'
import { Asset, AssetType, ImageSize, SharedLink } from './types'
import dayjs from 'dayjs'
class Render {
async assetBuffer (res: Response, asset: Asset, size?: ImageSize) {
@@ -10,7 +9,6 @@ class Render {
for (const header of ['content-type', 'content-length']) {
res.set(header, data.headers[header])
}
console.log(`${dayjs().format()} Serving asset ${asset.id}`)
res.send(Buffer.from(await data.arrayBuffer()))
} else {
res.status(404).send()