import { MIRROR_SCAN_BODY_KEYS } from "yt-dlp-transcript-common/controller/mirrorScan"; import { mirrorScanAction } from "../../../channels/[slug]/mirrorActions"; import { jobResponse, ops, optBool, reqSlug } from "../_lib"; export const dynamic = "force-dynamic"; // POST { slug, dryRun? } -> { ok: true, jobId } // // The mirror scan (release 31, lane D), as a `mirror-scan` job on its own // queue: the mirror channel's videos (config `mirror.of` names the creator's // channels) paired with the creator's by recorded date and title, into // `transcripts/mirrors/.json` — per mirror video its matches and status // (only-copy, creator-deleted, never-uploaded, creator-public), and the // creator's removed uploads in the mirror's window with the mirror's copies. // `dryRun: true` reads and matches the same and writes nothing. Refused before // any job for a channel with no `mirror.of`. The log ends `@@mirror-scan // {slug, dryRun, file?, of, missing?, window, videos, matched, byStatus, // byPlatform, creatorRemoved}`. // // AN ADAPTER: the refusals are the controller's (controller/mirrorScan.ts). export async function POST(request: Request) { return ops(request, MIRROR_SCAN_BODY_KEYS, async (body) => { const slug = reqSlug(body, "slug"); const dryRun = optBool(body, "dryRun"); return jobResponse(await mirrorScanAction(slug, { dryRun })); }); }