#116 Support custom URL links (slug-type links)
This commit is contained in:
+6
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user