From 1906f3ceebe81b7bedbcad5fe984bc3fd173b7a8 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Fri, 29 May 2026 17:29:16 +0800 Subject: [PATCH] Fix og:image video image --- app/src/views/gallery.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/views/gallery.tsx b/app/src/views/gallery.tsx index b52d9e4..c7b5ce2 100644 --- a/app/src/views/gallery.tsx +++ b/app/src/views/gallery.tsx @@ -50,7 +50,11 @@ export function Gallery (props: GalleryProps) { groupByDate: props.groupByDate }) const firstItem = props.items[0] - const ogImageUrl = firstItem ? props.publicBaseUrl + firstItem.previewUrl : '' + // For videos, previewUrl points to the .mp4; use thumbnailUrl so og:image is always a still JPEG. + const ogImageAsset = firstItem + ? (firstItem.type === AssetType.video ? firstItem.thumbnailUrl : firstItem.previewUrl) + : '' + const ogImageUrl = firstItem ? props.publicBaseUrl + ogImageAsset : '' return (