revert: restore storyboard intake workflow

This commit is contained in:
2026-05-19 16:17:58 +08:00
parent a7aa280330
commit b9ba8113f0
6 changed files with 55 additions and 260 deletions

View File

@@ -3785,16 +3785,6 @@ class RewriteStoryboardScriptReq(BaseModel):
segments: list[ScriptRewriteSegmentReq] = Field(default_factory=list)
class UpdateAudioScriptReq(BaseModel):
source_text: str | None = None
source_zh: str | None = None
rewritten_text: str | None = None
rewritten_text_zh: str | None = None
speaker_profile: str | None = None
rhythm_profile: str | None = None
background_audio_profile: str | None = None
_TRANSLATION_CACHE: dict[str, str] = {}
@@ -4282,33 +4272,6 @@ async def trigger_transcribe(job_id: str, bg: BackgroundTasks) -> Job:
return job_with_artifacts(job)
@app.patch("/jobs/{job_id}/audio-script", response_model=Job)
def update_audio_script(job_id: str, req: UpdateAudioScriptReq) -> Job:
job = JOBS.get(job_id)
if not job:
raise HTTPException(404, "job not found")
audio_script = job.audio_script or AudioScript()
patch: dict[str, str] = {}
for field in (
"source_text",
"source_zh",
"rewritten_text",
"rewritten_text_zh",
"speaker_profile",
"rhythm_profile",
"background_audio_profile",
):
value = getattr(req, field)
if value is not None:
patch[field] = str(value).strip()
if not patch:
return job_with_artifacts(job)
patch["status"] = "completed"
patch["created_at"] = audio_script.created_at or time.time()
update(job, audio_script=audio_script.model_copy(update=patch))
return job_with_artifacts(job)
@app.get("/jobs/{job_id}/video.mp4")
def get_video(job_id: str):
p = job_dir(job_id) / "source.mp4"