import Link from "next/link"; import { CLIP_DECK_SHOWS, type ClipDeckShow, projectsHref, takesHref } from "@/lib/hrefs"; import { clipDeckView } from "@/lib/report/clipDeck"; import { pieceHrefOfProject } from "@/lib/pieces/article"; import type { ProjectRef } from "@/lib/project-types"; import { BenchBody, BenchFrame, BenchTop } from "./bench/BenchShell"; import ClipDeck from "./review/ClipDeck"; import VoiceMatchPanel from "./report/VoiceMatchPanel"; import MontageFetchTools from "./report/MontageFetchTools"; import { lastStartedRun, projectFetchBody, readFetchRuns } from "@/lib/report/fetchWindows.mjs"; import { readVoiceMatch, voiceMatchSummary } from "yt-dlp-transcript-common/lib/montage/voiceMatch.mjs"; import { readManifest } from "@/lib/projects/report.mjs"; import { hasMontageClips } from "@/lib/report/montageRulings.mjs"; import ClipEditorPage from "./ClipEditorPage"; // `/projects//clips` -- THE CLIP DECK (release 34 N1): a montage's // every instance, one card at a time, its cut playing, ruled by ear: keep, cut, // not him (another speaker), read aloud (a post or a quote read out). The // rulings are /montage-rulings.json (lib/report/montageRulings.mjs) // and a render applies them (report-to-video/montage-rulings.mjs). Nothing // here calls a model; release 34 N2's voice-match.json, when it is there, // only orders the doubtful first and shows its score. export default async function ClipDeckPage({ project, show, mode, clip }: { project: ProjectRef; show?: string; mode?: string; clip?: string }) { // A cut that is not a montage -- an assistant's clips, any report video's -- // gets the clip editor (release 35 C2); `?mode=edit` opens it on a montage. // The montage deck below is unchanged. const manifest = await readManifest(project.dir); if (mode === "edit" || (manifest && !hasMontageClips(manifest))) return ; const view = await clipDeckView(project); const back = await pieceHrefOfProject(project.id, { tab: "cut" }); const top = ; if (!view || !view.cards.length) { return (

No montage clips in this cut.{" "} back to {project.id}

); } const initialShow: ClipDeckShow = (CLIP_DECK_SHOWS as readonly string[]).includes(show ?? "") ? (show as ClipDeckShow) : view.cards.every((c) => view.rulings[c.key]) ? "all" : "unruled"; // Fetch windows and the stand-ins for refused windows (release 35). const fetchBody = await projectFetchBody(project) .then(async ({ body, skipped }) => ({ items: body.items.length, skipped: skipped.length, lastRun: lastStartedRun(await readFetchRuns(project.dir)) })) .catch(() => null); return ( } fetchPanel={fetchBody ? : null} /> ); }