import { feedMetadataBackfillAction } from "../../../channels/[slug]/pipelineActions"; import { jobResponse, ops, optBool, reqSlug } from "../_lib"; export const dynamic = "force-dynamic"; // POST { slug: string, dryRun?: boolean } -> { ok: true, jobId } // // A podcast channel's records completed from its RSS feed: one fetch of the // channel's url, then title, date, description and duration into each record // that lacks them. `dryRun` logs matched / unmatched / already complete and // writes nothing. Follow the job's log for the counts. export async function POST(request: Request) { return ops(request, ["slug", "dryRun"], async (body) => jobResponse( await feedMetadataBackfillAction( reqSlug(body, "slug"), optBool(body, "dryRun"), ), ), ); }