添加图片预览api

This commit is contained in:
2026-03-13 22:07:33 +08:00
parent 8612b2dbde
commit 4be862d66b
16 changed files with 218 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
<script>
import { onMount } from 'svelte';
import { page } from '$app/state';
import { getPhoto, getPhotoFileUrl, getAlbumPhotos } from '$lib/api/client';
import { getPhoto, getPhotoFileUrl, getAlbumPhotos, getPhotoPreviewUrl } from '$lib/api/client';
import { m, loading } from '$lib/paraglide/messages';
/** @type {import('$lib/api/types').Photo|null} */
@@ -120,7 +120,7 @@
<source src={getPhotoFileUrl(photo.id)} type={photo.mimeType} />
</video>
{:else}
<img src={getPhotoFileUrl(photo.id)} alt={photo.fileName} />
<img src={getPhotoPreviewUrl(photo.id)} alt={photo.fileName} />
{/if}
</div>