Fix for non-200 responses

This commit is contained in:
Alan Grainger 2024-10-30 20:31:41 +01:00
parent 490f761661
commit 0d7d093e28
3 changed files with 4 additions and 4 deletions

4
dist/immich.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "immich-public-proxy", "name": "immich-public-proxy",
"version": "1.1.0", "version": "1.1.1",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"dev": "ts-node src/index.ts", "dev": "ts-node src/index.ts",

View File

@ -31,7 +31,7 @@ class Immich {
* The key is what is returned in the URL when you create a share in Immich. * The key is what is returned in the URL when you create a share in Immich.
*/ */
async getShareByKey (key: string) { async getShareByKey (key: string) {
const link = (await this.request('/shared-links/me?key=' + encodeURIComponent(key)) || []) as SharedLink const link = (await this.request('/shared-links/me?key=' + encodeURIComponent(key))) as SharedLink
if (link) { if (link) {
if (link.expiresAt && dayjs(link.expiresAt) < dayjs()) { if (link.expiresAt && dayjs(link.expiresAt) < dayjs()) {
// This link has expired // This link has expired