"use server"; import { getPaths } from "yt-dlp-transcript-common/lib/paths"; import { enqueueMirrorScan } from "yt-dlp-transcript-common/controller/mirrorScan"; import type { StreamActionResult } from "yt-dlp-transcript-common/jobs/streamCommand"; import { safeRevalidate } from "../../lib/safeRevalidate"; // The mirror scan (release 31, lane D; controller/mirrorScan.ts) as a // `mirror-scan` job: the Mirror stage's Scan button and `pnpm ops // mirror-scan`. A scan that wrote its file revalidates the channel page. export async function mirrorScanAction( slug: string, opts: { dryRun?: boolean } = {}, ): Promise { return enqueueMirrorScan( { slug, ...(opts.dryRun ? { dryRun: true } : {}) }, { paths: getPaths(), onDone: (s) => safeRevalidate([`/channels/${s}`]), }, ); }