Simple web backend added with upload/status/process/download API

This commit is contained in:
2026-07-30 12:24:37 +00:00
parent 277c538f21
commit cd56637d2a
20 changed files with 594 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Status query endpoint."""
from fastapi import APIRouter, HTTPException
from backend.models.response import StatusResponse
from backend.services.task_manager import task_manager
router = APIRouter(prefix="/api", tags=["status"])
@router.get("/status/{task_id}", response_model=StatusResponse)
async def get_status(task_id: str):
if not task_manager.has_task(task_id):
raise HTTPException(status_code=404, detail=f"Task {task_id} not found")
status = task_manager.get_status(task_id)
return StatusResponse(
task_id=task_id,
status=status["status"],
progress=status["progress"],
message=status["message"],
error=status.get("error"),
tracks=status.get("tracks", [])
)