Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 266881d6363bfaa531aef3bed26ea8f3bce0c582
parent fbc68b9460087dbedffd2c73bbe3e70da4f77066
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 16:59:59 -0400

channels: the Configure form shows the audio check on by default for an Odysee channel, and unticking writes the opt-out

An Odysee channel with no `audioCheck` has the check on (lib/audioCheckPolicy.ts)
but the box showed unticked. It now shows ticked, says "on by default for
Odysee", and follows the URL in create mode; a save left ticked writes nothing,
unticked writes `{enabled: false}`. channelConfigToFormData ticks it the same
way, so `pnpm ops channel-config` keeps the default through an unrelated patch
and `{"audioCheckEnabled": false}` turns it off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Meditor/app/channels/components/ChannelForm.tsx | 22++++++++++++++++++++--
Meditor/app/channels/components/channelConfigToForm.ts | 9+++++++++
Meditor/app/channels/components/parseChannelForm.test.ts | 33+++++++++++++++++++++++++++++++++
Meditor/app/channels/components/parseChannelForm.ts | 10++++++++++
4 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/editor/app/channels/components/ChannelForm.tsx b/editor/app/channels/components/ChannelForm.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import slugify from "@sindresorhus/slugify"; import type { ChannelConfig } from "yt-dlp-transcript-common/lib/channelConfig"; +import { AUDIO_CHECK_PLATFORMS } from "yt-dlp-transcript-common/lib/audioCheckPolicy"; import { detectPlatform, isSocialPlatform, @@ -711,7 +712,11 @@ export function ChannelForm({ </span> </span> </label> - <AudioCheckFields config={c} state={state} /> + <AudioCheckFields + config={c} + state={state} + defaultOn={AUDIO_CHECK_PLATFORMS.includes(platform || detectPlatform(url) || "")} + /> </Section> <Section title="Retention & persistence"> <label className="flex flex-col gap-1 text-sm"> @@ -1069,16 +1074,23 @@ function SyncIntervalField({ function AudioCheckFields({ config, state, + defaultOn, }: { config?: ChannelConfig; state?: SeedSource; + // The channel's platform has the check on unless it says otherwise + // (lib/audioCheckPolicy.ts: Odysee). Unticking then writes {enabled: false}. + defaultOn: boolean; }) { const ac = config?.audioCheck; - const enabled = ac?.enabled === true; + const enabled = ac?.enabled === true || (defaultOn && ac?.enabled !== false); return ( <div className="flex flex-col gap-3 mt-1"> <label className="flex items-start gap-2 text-sm"> <input + // Remounted when the platform's default changes (create mode follows + // the URL), so the box shows the default it would save. + key={defaultOn ? "default-on" : "opt-in"} type="checkbox" name="audioCheckEnabled" defaultChecked={seedChecked(state, "audioCheckEnabled", enabled)} @@ -1091,6 +1103,12 @@ function AudioCheckFields({ <span className="text-muted-foreground font-normal"> (transcribe only, slow) </span> + {defaultOn && ( + <span className="text-muted-foreground font-normal" aria-label="audio check default"> + {" "} + · on by default for Odysee + </span> + )} </span> <span className="text-xs text-muted-foreground"> For sources that intermittently serve corrupt audio (e.g. Odysee diff --git a/editor/app/channels/components/channelConfigToForm.ts b/editor/app/channels/components/channelConfigToForm.ts @@ -1,4 +1,6 @@ import type { ChannelConfig } from "yt-dlp-transcript-common/lib/channelConfig"; +import { detectPlatform } from "yt-dlp-transcript-common/lib/platform"; +import { AUDIO_CHECK_PLATFORMS } from "yt-dlp-transcript-common/lib/audioCheckPolicy"; // THE INVERSE OF parseChannelForm, and it exists for exactly one caller: // /api/ops/channel-config. @@ -118,6 +120,13 @@ export function channelConfigToFormData(config: ChannelConfig): FormData { ); put(fd, "recordedDateTitlePattern", config.recordedDate?.titlePattern); put(fd, "mirrorOf", config.mirror?.of.join(", ")); + // Ticked when the check is on: said so, or the platform's default (an + // Odysee channel with no `audioCheck`; lib/audioCheckPolicy.ts) — so a patch + // that does not name it keeps what the channel has. + const platform = config.platform ?? (config.url ? detectPlatform(config.url) : null); + if (config.audioCheck?.enabled === undefined && platform && AUDIO_CHECK_PLATFORMS.includes(platform)) { + fd.set("audioCheckEnabled", "on"); + } if (config.audioCheck?.enabled) { fd.set("audioCheckEnabled", "on"); putNum(fd, "audioCheckIntervalSeconds", config.audioCheck.intervalSeconds); diff --git a/editor/app/channels/components/parseChannelForm.test.ts b/editor/app/channels/components/parseChannelForm.test.ts @@ -85,3 +85,36 @@ test("the ops patch sets and clears mirrorOf over the channel's current form", ( applyChannelFormPatch(back, { mirrorOf: "" }); assert.equal("mirror" in parseChannelForm(back).config, false); }); + +// The audio check on an Odysee channel (release 32): on by default +// (lib/audioCheckPolicy.ts), so the box shows ticked with nothing stored; a +// save that leaves it ticked writes nothing, unticking writes the opt-out, and +// the ops patch keeps either through the round trip. + +const ODYSEE = "https://odysee.com/@synth:0"; + +test("an Odysee channel: ticked with nothing else is the default (nothing written), unticked writes enabled: false", () => { + assert.equal("audioCheck" in parseChannelForm(form({ url: ODYSEE, audioCheckEnabled: "on" })).config, false); + assert.deepEqual(parseChannelForm(form({ url: ODYSEE })).config.audioCheck, { enabled: false }); + assert.deepEqual(parseChannelForm(form({ url: ODYSEE, audioCheckEnabled: "on", audioCheckIntervalSeconds: "60" })).config.audioCheck, { + enabled: true, + intervalSeconds: 60, + }); + // Elsewhere the check stays an opt-in. + assert.equal("audioCheck" in parseChannelForm(form({ url: "https://www.youtube.com/@synth" })).config, false); + assert.deepEqual(parseChannelForm(form({ url: "https://www.youtube.com/@synth", audioCheckEnabled: "on" })).config.audioCheck, { enabled: true }); +}); + +test("the ops patch keeps an Odysee channel's default, and turns it off with audioCheckEnabled: false", () => { + const base = { handling: "transcribe" as const, name: "Synth", url: ODYSEE }; + const fd = channelConfigToFormData(base); + assert.equal(fd.get("audioCheckEnabled"), "on"); + applyChannelFormPatch(fd, { mirrorOf: "creator-yt" }); + assert.equal("audioCheck" in parseChannelForm(fd).config, false, "an unrelated patch writes no audioCheck"); + applyChannelFormPatch(fd, { audioCheckEnabled: false }); + const off = parseChannelForm(fd).config; + assert.deepEqual(off.audioCheck, { enabled: false }); + const back = channelConfigToFormData(off); + assert.equal(back.get("audioCheckEnabled"), null, "the opt-out round-trips unticked"); + assert.deepEqual(parseChannelForm(back).config.audioCheck, { enabled: false }); +}); diff --git a/editor/app/channels/components/parseChannelForm.ts b/editor/app/channels/components/parseChannelForm.ts @@ -28,6 +28,7 @@ import { downloadFilterPatternProblem } from "yt-dlp-transcript-common/lib/downl import { recordedDatePatternProblem } from "yt-dlp-transcript-common/lib/recordedDate"; import { mirrorSlugs } from "yt-dlp-transcript-common/lib/mirrors/config"; import { isRejectedLivestreamMode } from "yt-dlp-transcript-common/lib/channelConfig"; +import { AUDIO_CHECK_PLATFORMS } from "yt-dlp-transcript-common/lib/audioCheckPolicy"; export type ParsedChannelForm = { name: string; @@ -361,6 +362,15 @@ export function parseChannelForm(formData: FormData): ParsedChannelForm { audioCheck.resumeDuringProbe = true; } } + // ON BY DEFAULT ON A PLATFORM KNOWN FOR CORRUPT AUDIO (release 31's + // lib/audioCheckPolicy.ts; the form says so since release 32): the box + // shows ticked there with no `audioCheck` stored. Ticked with nothing else + // set is that default — nothing is written; unticked writes the opt-out. + const audioCheckDefaultOn = platform !== undefined && AUDIO_CHECK_PLATFORMS.includes(platform); + if (audioCheckDefaultOn) { + if (!audioCheck) audioCheck = { enabled: false }; + else if (Object.keys(audioCheck).length === 1) audioCheck = undefined; + } const config: ChannelConfig = { handling: handlingRaw,