"use client"; import { useState } from "react"; import Link from "next/link"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "yt-dlp-transcript-common/components/ui/collapsible"; // The five-line paragraph that used to sit under the page title, folded away. // It is reference material — true, worth having, and read once — so it was // costing every subsequent visit the height of the answer to "what is it doing // right now", which is the question people actually arrive with. // // `compiled` says whether the rules below are GENERATED from the channel // priorities rather than hand-authored here. It changes what the last paragraph // claims, because with a priority model set "read top to bottom" is still true // and "edit them here" is not: the compiler wins at dispatch, so a rule typed // into this tree could not change what the lane does. export function HowPriorityWorks({ compiled = false }: { compiled?: boolean }) { const [open, setOpen] = useState(false); return ( How priority works {open ? "⌃" : "⌄"}

Rules are read top to bottom: the highest one with available work claims the next freed worker slot, and when its work runs out the runner falls through to the next rule automatically. Wrap rules in a group set to round-robin or weighted-fair to alternate between them instead.

Order sorts videos{" "} inside each rule, across every channel and bucket that rule claims. Rule order still wins — for a pure newest-first archive, use one catch-all rule.

{/* THE TREE IS GENERATED, and this is where that is said in prose — the read-only ladder says it as a state, this says it as a rule. Drawn in both cases because "where do the rules come from" has an answer either way, and the two answers are different. */}

{compiled ? ( <> These rules are generated {" "} from the channel priorities — one tier per channel plus one focus — set on{" "} the channels page . All four lanes are compiled from that one document, so a focus group sits at the top of every one of them and the tree below is read-only here. ) : ( <> No channel priorities are set, so these rules are hand-authored here. Setting a tier or a focus on{" "} the channels page {" "} generates all four lanes’ rules instead, and this tree becomes read-only. )}

A video is claimed by exactly one rule (the first that matches), so overlapping rules never double-process it. This is independent of the{" "} sync schedule , which only decides when to re-fetch each channel, and manual batches keep working alongside it.

); }