// The Playlist stage's metadata-scan view model. // // DELIBERATELY NOT IN PlaylistStage.tsx. That file is `"use client"`, and a // value imported from a client module into a Server Component is replaced by a // client REFERENCE — not the value. `MATCHED_PREVIEW_LIMIT` exported from there // reached the server as an object, `slice(0, )` became `slice(0, NaN)`, // and the matched-titles list rendered empty while the count beside it said 2. // Types alone would have been safe (they are erased); the constant is what // forced this module to exist. import type { MetadataScanRun } from "yt-dlp-transcript-common/controller/metadataScanStore"; // How many matched titles the stage lists. An eyeball check that the regex // caught what the operator meant, not an inventory — the full answer is the // channel's download list. export const MATCHED_PREVIEW_LIMIT = 50; export type MetadataScanMatch = { id: string; uploadDate: string; title: string; }; export type MetadataScanView = { listed: number; scanned: number; errors: number; unscanned: number; lastRun: MetadataScanRun | null; filterConfigured: boolean; filteredOut: number; matchedTotal: number; // The split of `matchedTotal`: how many passed on their title/description and // how many only because "Include every livestream" is on. Without the split, // turning that switch on looks identical to widening the regex. matchedByText: number; matchedLivestreams: number; matched: MetadataScanMatch[]; };