Captions for uploaded videos (migration 066)

Video blocks get a Captions field and the hero a Video captions field,
each a WebVTT upload drawn as <track kind="captions" default> on a
video file. The media library takes .vtt (sniffed by its WEBVTT
header, kept as is, always in /uploads/captions/) with its own tab.
Newsletter parts leave the field out. nginx needs text/vtt in
mime.types: docs/media-uploads.md, step 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-04 21:55:05 -05:00
parent aaab1a945c
commit 33be618331
18 changed files with 123 additions and 43 deletions

View file

@ -66,7 +66,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
const blockRows = db
.prepare(
`SELECT id, owner_id, type, text, media, href, alt, cite, team_id
`SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id
FROM content_blocks
WHERE owner_kind = ? AND slot = ? AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,
@ -85,6 +85,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
href: row.href,
alt: row.alt,
cite: row.cite,
captions: row.captions,
team_id: row.team_id,
items: [],
};