Archilyzer · Source

archilyzer

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

commit 3fc664809125df239ff647ee462243d2f3314812
parent 71530ad0e44787a58394d115ac73e1df569ab81f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 17 Oct 2026 02:02:17 -0400

editor: the Transcribe row of a corrupt full source still owed its stored-URL downloads says full audio comes first and offers Salvage now (transcribe-one's salvage: true, from the UI); e2e

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

Diffstat:
Meditor/app/channels/[slug]/videos/[id]/components/VideoPanel.tsx | 14+++++++++++++-
Meditor/app/channels/[slug]/videos/[id]/components/cards/PerFileTranscribeRow.tsx | 25+++++++++++++++++++++++++
Meditor/e2e/full-audio-first.spec.ts | 17++++++++++++++---
3 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/editor/app/channels/[slug]/videos/[id]/components/VideoPanel.tsx b/editor/app/channels/[slug]/videos/[id]/components/VideoPanel.tsx @@ -8,7 +8,7 @@ // The registry-driven operation panels (digest, diarization, attribution) render // after this component, in page.tsx. -import { FULL_AUDIO_ATTEMPTS, fullAudioAttemptsOf } from "yt-dlp-transcript-common/lib/fullAudioFirst"; +import { FULL_AUDIO_ATTEMPTS, fullAudioAttemptsOf, fullAudioState } from "yt-dlp-transcript-common/lib/fullAudioFirst"; import type { AudioFormat, ChannelHandling, @@ -164,6 +164,17 @@ export function VideoPanel({ : "Audio not yet downloaded." : `${audioFiles.length} audio file${audioFiles.length === 1 ? "" : "s"} on disk.`; const salvageShown = hasTranscriptJson && salvaged !== null; + // Release 32 R8: a corrupt full source still owed its stored-URL downloads + // before a salvage (lib/fullAudioFirst.ts) — the Transcribe row says so and + // offers Salvage now. + const fullAudioGate = storedMediaHost + ? fullAudioState(downloadOutcome, { + storedUrlTrusted: true, + handling, + ...(channelStoredUrl ? { mode: channelStoredUrl } : {}), + }) + : null; + const fullAudioOwed = fullAudioGate && !fullAudioGate.exhausted ? fullAudioGate : null; const transcribeSummary = autoSubsOnly ? "YouTube auto-captions only — can be replaced with an AI transcript." : salvageShown @@ -345,6 +356,7 @@ export function VideoPanel({ existingQueues={existingQueues} hasTranscript={hasTranscript && !autoSubsOnly} replaceAutoSubs={autoSubsOnly} + fullAudio={fullAudioOwed} /> ))} </div> diff --git a/editor/app/channels/[slug]/videos/[id]/components/cards/PerFileTranscribeRow.tsx b/editor/app/channels/[slug]/videos/[id]/components/cards/PerFileTranscribeRow.tsx @@ -9,6 +9,7 @@ import { } from "../../videoActions"; import { Heading } from "./Heading"; import type { VideoFile } from "./videoFiles"; +import type { FullAudioState } from "yt-dlp-transcript-common/lib/fullAudioFirst"; export function PerFileTranscribeRow({ slug, @@ -17,6 +18,7 @@ export function PerFileTranscribeRow({ existingQueues, hasTranscript, replaceAutoSubs = false, + fullAudio = null, }: { slug: string; videoId: string; @@ -26,6 +28,10 @@ export function PerFileTranscribeRow({ // The existing transcript is YouTube ASR: transcribing is offered (and // labelled as a replacement) rather than blocked. replaceAutoSubs?: boolean; + // Release 32 R8: a corrupt full source still owed its stored-URL downloads + // (lib/fullAudioFirst.ts). Transcribe makes them first; Salvage now makes + // the partial transcript from this file at once. + fullAudio?: FullAudioState | null; }) { const [transcribeQueue, setTranscribeQueue] = useState(""); // `hasTranscript` is SERVER-derived (VideoPanel, the Transcribe card) and this row's own run @@ -59,6 +65,12 @@ export function PerFileTranscribeRow({ Transcribe disabled — transcript already present. </p> ) : null} + {fullAudio && !hasTranscript ? ( + <p role="status" aria-label="full audio first" className="text-sm text-warning"> + Full audio first: {fullAudio.attempts} of {fullAudio.of} downloads from the stored media URL made. Transcribe + downloads the rest first (20 minutes apart) and makes a partial transcript only if none comes back clean. + </p> + ) : null} {hasTranscript && !ranHere ? null : ( <StreamActionLog key="transcribe-run" @@ -91,6 +103,19 @@ export function PerFileTranscribeRow({ } /> )} + {fullAudio && !hasTranscript && ( + <StreamActionLog + key="salvage-run" + trigger={() => { + setRanHere(true); + return transcribeOneAction(slug, videoId, file.name, transcribeQueue, true); + }} + cancelAction={cancelJobAction} + buttonLabel={`Salvage now (${file.name})`} + runningLabel="Salvaging…" + label={`Salvage ${file.name}`} + /> + )} </div> ); } diff --git a/editor/e2e/full-audio-first.spec.ts b/editor/e2e/full-audio-first.spec.ts @@ -34,7 +34,8 @@ async function video(id: string, storedAttempts: number, salvaged: boolean) { duration: 600, formats: [{ url: `https://player.odycdn.com/v6/streams/${id}/a1b2c3.mp4`, protocol: "https", ext: "mp4" }], }); - await put("audio.mp4", "kept malformed bytes"); + // The kept file in the channel's format (m4a), as the audio check keeps it. + await put("audio.m4a", "kept malformed bytes"); await put("download-outcome.json", { videoId: id, status: "corrupt-full-source", @@ -50,7 +51,7 @@ async function video(id: string, storedAttempts: number, salvaged: boolean) { await put("transcribe-outcome.json", { videoId: id, transcribedAt: "2026-10-16T01:00:00.000Z", - salvaged: { source: "audio.mp4", decodedSeconds: 300, totalSeconds: 600, gaps: [[300, 600]] }, + salvaged: { source: "audio.m4a", decodedSeconds: 300, totalSeconds: 600, gaps: [[300, 600]] }, }); } } @@ -75,6 +76,16 @@ test("the line names the corrupt full sources awaiting full audio, and the salva await page.goto(`/channels/${CHANNEL}/videos/${SALVAGED}`); const notice = page.getByRole("status", { name: "salvaged transcript" }); - await expect(notice).toContainText("Salvaged transcript — 5:00 of 10:00 of audio.mp4 decoded."); + await expect(notice).toContainText("Salvaged transcript — 5:00 of 10:00 of audio.m4a decoded."); await expect(notice).toContainText("Full audio attempts: 1 of 2."); + + // The waiting one: Transcribe says the full audio comes first, and Salvage now + // is there for a person who wants the partial transcript at once (not pressed: + // nothing is transcribed here). + await page.goto(`/channels/${CHANNEL}/videos/${WAITING}`); + await expect(page.getByRole("status", { name: "full audio first" })).toContainText( + "Full audio first: 0 of 2 downloads from the stored media URL made.", + ); + await expect(page.getByRole("button", { name: "Salvage now (audio.m4a)" })).toBeVisible(); + await expect(page.getByRole("button", { name: "Transcribe audio.m4a" })).toBeVisible(); });