diff --git a/frontend/src/lib/api/endpoints/share.ts b/frontend/src/lib/api/endpoints/share.ts index 1b69f68a..154d3f4f 100644 --- a/frontend/src/lib/api/endpoints/share.ts +++ b/frontend/src/lib/api/endpoints/share.ts @@ -9,6 +9,16 @@ import type { ItemType } from '$lib/api/types'; export interface ShareMeta { item_type: ItemType; item_name: string; + /** The shared item's id — file shares use it to build the preview src. */ + item_id: string; + /** + * File shares only: resolved by the server at read time so the landing + * page can inline a media preview (video player / image) instead of a + * bare download button. Absent for folder shares. + */ + mime_type?: string; + /** File shares only: the shared file's size in bytes. */ + size?: number; } export interface ShareFolderEntry { diff --git a/frontend/src/routes/s/[token]/+page.svelte b/frontend/src/routes/s/[token]/+page.svelte index 570a536c..9e61d933 100644 --- a/frontend/src/routes/s/[token]/+page.svelte +++ b/frontend/src/routes/s/[token]/+page.svelte @@ -287,7 +287,29 @@ {:else if view === 'file'}
- + {#if meta && mediaKind(meta.mime_type) === 'video'} + + + {:else if meta && mediaKind(meta.mime_type) === 'image'} + + {:else} +