"use client"; import { useState } from "react"; import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog"; import { cancelJobAction } from "../../../jobs/actions"; import { feedMetadataBackfillAction, importArchiveOrgAction, remoteListingAction } from "../pipelineActions"; // Channel operations that were ops-only (release 32), on the Download stage: // an archive.org item imported (`import-archive-org`), the records completed // from the channel's RSS feed (`feed-metadata`), and an Odysee or BitChute // channel's remote listing read against what it holds (`remote-listing`). // Each that writes previews first. export function ChannelImportTools({ slug, remoteListing }: { slug: string; remoteListing: boolean }) { const [item, setItem] = useState(""); const [match, setMatch] = useState(""); const itemKey = `${item}\u0000${match}`; const [itemPreviewed, setItemPreviewed] = useState(null); const [feedPreviewed, setFeedPreviewed] = useState(false); const itemOpts = { item: item.trim(), ...(match.trim() ? { match: match.trim() } : {}) }; return (
More ways in

Import from archive.org

importArchiveOrgAction(slug, { ...itemOpts, dryRun: true })} cancelAction={cancelJobAction} buttonLabel="Preview import" runningLabel="Reading the item…" label={`Preview archive.org import into ${slug}`} disabled={!item.trim()} onSettled={(started) => setItemPreviewed(started ? itemKey : null)} /> importArchiveOrgAction(slug, itemOpts)} cancelAction={cancelJobAction} buttonLabel="Import" runningLabel="Importing…" label={`Import from archive.org into ${slug}`} disabled={itemPreviewed !== itemKey} />

Complete records from the feed

feedMetadataBackfillAction(slug, true)} cancelAction={cancelJobAction} buttonLabel="Preview feed backfill" runningLabel="Reading the feed…" label={`Preview feed backfill of ${slug}`} onSettled={(started) => setFeedPreviewed(started)} /> feedMetadataBackfillAction(slug)} cancelAction={cancelJobAction} buttonLabel="Complete from the feed" runningLabel="Completing…" label={`Feed backfill of ${slug}`} disabled={!feedPreviewed} />
{remoteListing && (

Remote listing

remoteListingAction(slug)} cancelAction={cancelJobAction} buttonLabel="Read the remote listing" runningLabel="Reading…" label={`Remote listing of ${slug}`} />
)}
); }