diff --git a/app/routers/runs.py b/app/routers/runs.py index 865023f..3632c64 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -1351,11 +1351,26 @@ async def get_ipfs_stream_info(run_id: str, request: Request): # Task is still running - check database for live playlist updates ipfs_playlist_cid = pending.get("ipfs_playlist_cid") + # Get task state and progress metadata + task_state = result.state + task_info = result.info if isinstance(result.info, dict) else {} + response_data = { "run_id": run_id, - "status": pending.get("status", "pending"), + "status": task_state.lower() if task_state else pending.get("status", "pending"), } + # Add progress metadata if available + if task_info: + if "progress" in task_info: + response_data["progress"] = task_info["progress"] + if "frame" in task_info: + response_data["frame"] = task_info["frame"] + if "total_frames" in task_info: + response_data["total_frames"] = task_info["total_frames"] + if "percent" in task_info: + response_data["percent"] = task_info["percent"] + if ipfs_playlist_cid: response_data["ipfs_playlist_cid"] = ipfs_playlist_cid response_data["ipfs_playlist_url"] = f"{gateway}/{ipfs_playlist_cid}"