#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
+6 -1
View File
@@ -156,12 +156,13 @@ class Immich {
if (res.status === 200) {
// Normal response - get the shared assets
link = jsonBody as SharedLink
link.keyType = keyType
// For an album, we need to make a second request to Immich to populate
// the array of assets
if (link.type === AlbumType.album) {
const albumRes = await fetch(this.buildUrl(this.apiUrl() + '/albums/' + link?.album?.id, {
key,
[keyType]: key,
password
}))
const album = await albumRes.json() as Album
@@ -310,6 +311,10 @@ class Immich {
return size as ImageSize
}
}
getKeyTypeFromShare (shareType: string) {
return shareType === 's' ? KeyType.slug : KeyType.key
}
}
const immich = new Immich()