Skip to content

Commit 89e07a8

Browse files
committed
fix(cli): adapt the captions runner to the STT status object
The 1.8 line turned the renderer's transcription callback from a bare phase string into an object (phase + progress fields — see `SttRendererStatus`), while main's CLI captions runner was still typed against the string. The two lines merge without a textual conflict, so the break surfaced only as two tsc errors in CliCaptionsRunner.tsx once main was replayed on top of 1.8. Only the phase is read here, so the call site destructures it.
1 parent b07a94d commit 89e07a8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/cli/CliCaptionsRunner.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "@/components/video-editor/projectPersistence";
1212
import type { AnnotationRegion, TrimRegion } from "@/components/video-editor/types";
1313
import { extractMono16kFromVideoUrl } from "@/lib/captioning/extractMono16k";
14-
import { transcribeMono16kToSegments } from "@/lib/captioning/transcribe";
14+
import { type SttRendererStatus, transcribeMono16kToSegments } from "@/lib/captioning/transcribe";
1515
import type { CliCaptionsRequest, CliDoneResult } from "@/lib/cliContracts";
1616
import { nativeBridgeClient } from "@/native";
1717
import { captionSegmentsToAnnotationRegions } from "./captionAnnotations";
@@ -62,7 +62,9 @@ async function runCaptions(request: CliCaptionsRequest): Promise<CliDoneResult>
6262
const trimRegionsForTranscribe = shiftTrimRegionsMsForCaptionBuffer(trimRegions, trimMs);
6363

6464
const transcribeOptions = {
65-
onStatus: (phase: "model" | "transcribe") => {
65+
// The renderer now reports an object (phase + progress fields), not a bare
66+
// phase string — see SttRendererStatus. Only the phase is logged here.
67+
onStatus: ({ phase }: SttRendererStatus) => {
6668
window.electronAPI.cliLog(
6769
"info",
6870
phase === "model" ? "Loading caption model…" : "Transcribing…",

0 commit comments

Comments
 (0)