refactor(web): use ImmichApi to create urls (#2435)

This commit is contained in:
Michel Heusschen
2023-05-14 04:52:29 +02:00
committed by GitHub
parent 15fa8250cb
commit 4524aa0d06
13 changed files with 53 additions and 51 deletions

View File

@@ -1,6 +1,5 @@
import { error } from '@sveltejs/kit';
import { getThumbnailUrl } from '$lib/utils/asset-utils';
import { ThumbnailFormat } from '@api';
import { ThumbnailFormat, api as clientApi } from '@api';
import type { PageServerLoad } from './$types';
import featurePanelUrl from '$lib/assets/feature-panel.png';
@@ -19,7 +18,7 @@ export const load = (async ({ params, locals: { api } }) => {
title: sharedLink.album ? sharedLink.album.albumName : 'Public Share',
description: sharedLink.description || `${assetCount} shared photos & videos.`,
imageUrl: assetId
? getThumbnailUrl(assetId, ThumbnailFormat.Webp, sharedLink.key)
? clientApi.getAssetThumbnailUrl(assetId, ThumbnailFormat.Webp, sharedLink.key)
: featurePanelUrl
}
};