a video in a carousel gets its poster, not a 404

A video has no width rungs — poster-448.webp and friends are cut from a still —
so asking for 320.webp returns a 404 and the grid drew a broken tile with no clue
why. Every grid in the panel was doing it, and a carousel is explicitly allowed
to hold both kinds.

posterUrl already existed for this and nothing called it. mediaThumbUrl decides
from the extension so a screen showing mixed media does not have to know the
difference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-05 14:32:52 +01:00
co-authored by Claude Opus 5
parent b7455c0470
commit 55be0a1860
3 changed files with 21 additions and 4 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { Input } from '@/components/ui/input';
import { useClient } from 'hooks/useClient';
import { MediaPicker } from '../MediaPicker';
import { readableError } from '../errors';
import { thumbUrl } from '../thumbnail';
import { mediaThumbUrl } from '../thumbnail';
/**
* One carousel's contents: what is in it, in what order, and what each picture is called.
@@ -151,7 +151,7 @@ export const CarouselItems = ({ carouselId, onChanged }: { carouselId: number; o
and a browser cannot show the original at all.
*/}
<img
src={thumbUrl(item.url)}
src={mediaThumbUrl(item.url)}
alt=""
loading="lazy"
className="size-24 shrink-0 rounded bg-muted object-cover"