auto-save 2026-05-14 04:04 (~6)

This commit is contained in:
2026-05-14 04:04:54 +08:00
parent b95706a3e4
commit 87f1182afe
6 changed files with 171 additions and 65 deletions

View File

@@ -129,6 +129,7 @@ export interface KeyFrame {
}
export type FrameExtractTarget = "balanced" | "subject" | "transition" | "expression" | "motion"
export type FrameExtractMode = "replace" | "append"
export interface TranscriptSegment {
index: number
@@ -261,8 +262,13 @@ export async function triggerTranscribe(id: string): Promise<Job> {
return res.json()
}
export async function analyzeJob(id: string, frames = 5, target: FrameExtractTarget = "balanced"): Promise<Job> {
const qs = new URLSearchParams({ frames: String(frames), target })
export async function analyzeJob(
id: string,
frames = 5,
target: FrameExtractTarget = "balanced",
mode: FrameExtractMode = "replace",
): Promise<Job> {
const qs = new URLSearchParams({ frames: String(frames), target, mode })
const res = await fetch(`${API_BASE}/jobs/${id}/analyze?${qs.toString()}`, { method: "POST" })
if (!res.ok) {
const t = await res.text().catch(() => "")