#116 Support custom URL links (slug-type links)

This commit is contained in:
Alan Grainger
2025-09-20 20:10:46 +02:00
parent 033d49dd75
commit e7dc11a66c
8 changed files with 55 additions and 36 deletions
+12
View File
@@ -16,6 +16,18 @@ class Render {
* Stream data from Immich back to the client
*/
async assetBuffer (req: IncomingShareRequest, res: Response, asset: Asset, size?: ImageSize | string) {
// Get meta info regarding the asset
const metaRes = await fetch(immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id), {
key: asset.key
}))
const meta = await metaRes.json()
// Make sure we should display this asset
if (meta.isTrashed || meta.visibility === 'locked') {
respondToInvalidRequest(res, 404)
return
}
// Prepare the request
const headerList = ['content-type', 'content-length', 'last-modified', 'etag']
size = immich.validateImageSize(size)