"use client"; import type { ClipProvenance } from "yt-dlp-transcript-common/lib/clipWindow"; import { formatBytes, formatDuration } from "yt-dlp-transcript-common/lib/format"; // A window of source media this editor fetched because another tool asked. export type FetchedWindow = { file: string; from: number; to: number; bytes: number; provenance: ClipProvenance | null; }; // WHO ASKED, FOR WHAT, AND WHY — the three things a `clips/` directory has to // be able to answer months later, when the only other record (the job log) has // been pruned. Modelled on PersistedSourceVideo (SourceVideoSection.tsx), which answers the same // question for a whole container. export function FetchedWindows({ windows }: { windows: FetchedWindow[] }) { return (

Seconds of this video's source media, fetched through the managed download path because a tool asked for them, and kept in{" "} clips/ so the next tool reuses them instead of paying for the same bytes again.

{/* A WINDOW IS NOT A DOWNLOAD. Thirty seconds of a stream is not the video, and nothing downstream treats it as one: the fetch writes no metadata.info.json, so this video stays exactly as undownloaded (and as absent from the index) as it was. */}

Fetched windows do not make this video downloaded: they carry no metadata, so the video's pipeline state and its place in the index are unchanged.

{/* WHAT THEY COST, AND THAT NOTHING RECLAIMS IT. The retention sweep is pointer-driven and never sees a window; the cleanup lanes are about `audio.*`. The only thing that removes one is Evict fetched windows on /storage, and it evicts BY AGE — which surfaces have to say, because a window a report still cites looks identical to one nothing wants. */}

{formatBytes(windows.reduce((n, w) => n + w.bytes, 0))} in total, counted in this channel's media size. Nothing prunes a window on its own — Storage evicts them by age.

); }