Updated logging
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user