// The cited clip's shapes, shared by the server (lib/clips/cited.ts, the // /api/cited routes) and the player (components/clips/CitedClip.tsx). /** What can play a cited span, best first: prepared, a clip window, a saved video, audio. */ export type CitedPlay = { kind: "prepared" | "window" | "saved" | "audio"; url: string; /** Seconds into the file where the cited span starts. */ offset: number; audio: boolean; label: string; /** * The regions the project hides on this recording (clip-censor.mjs: the clip's own and render.censor's, or the * recording's alone where no clip is named), on the SOURCE clock: the player overlays them. Absent: none. */ hidden?: Array<{ box: number[]; style: "blur" | "black" | "pixelate"; strength: number; from: number | null; to: number | null }>; }; /** * The span a citation names. `channel`/`video` are the corpus's directories * (a Rumble entry's local dir is `video`, never its `siteVideo`). With * `project`+`clip` the project's own cached windows are asked first. */ export type CitedTarget = { channel: string; video: string; from: number; to: number; project?: string; clip?: string; /** An audio citation: never look for a picture. */ audio?: boolean; }; /** One answer of the fetch route: ready (and what plays now), still going, or why not, in plain words. */ export type CitedFetchAnswer = | { state: "ready"; cached: boolean; from?: number; to?: number; play: CitedPlay | null } | { state: "queued"; job: string; status: string } | { state: "failed"; message: string; detail?: string; job?: string }; export const citedKey = (t: CitedTarget) => [t.channel, t.video, t.from, t.to, t.project ?? "", t.clip ?? "", t.audio ? "a" : ""].join("|");