auto-save 2026-05-14 02:58 (~6)
This commit is contained in:
13
api/main.py
13
api/main.py
@@ -989,6 +989,19 @@ def get_job(job_id: str) -> Job:
|
||||
return job
|
||||
|
||||
|
||||
@app.delete("/jobs/{job_id}")
|
||||
def delete_job(job_id: str) -> dict[str, bool | str]:
|
||||
d = (JOBS_DIR / job_id).resolve()
|
||||
if JOBS_DIR not in d.parents:
|
||||
raise HTTPException(400, "invalid job id")
|
||||
job = JOBS.pop(job_id, None)
|
||||
if not job and not d.exists():
|
||||
raise HTTPException(404, "job not found")
|
||||
if d.exists():
|
||||
shutil.rmtree(d)
|
||||
return {"ok": True, "id": job_id}
|
||||
|
||||
|
||||
@app.post("/jobs/{job_id}/transcribe", response_model=Job)
|
||||
async def trigger_transcribe(job_id: str, bg: BackgroundTasks) -> Job:
|
||||
job = JOBS.get(job_id)
|
||||
|
||||
Reference in New Issue
Block a user