From 932dc71b8a9ce7934751c4e0888f843a24410a18 Mon Sep 17 00:00:00 2001 From: keboss-m <85340750+keboss-m@users.noreply.github.com> Date: Mon, 1 Jun 2026 10:24:19 +0300 Subject: [PATCH] Fix task queue display: consistent task_id keys in frontend, add file field to WebSocket progress --- backend/queue.py | 2 ++ backend/static/app.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/queue.py b/backend/queue.py index fe60095..d0e6e38 100644 --- a/backend/queue.py +++ b/backend/queue.py @@ -39,11 +39,13 @@ async def _send_progress(task_id: str, progress: int, message: str, status: str, """Отправляет прогресс через callback.""" if _progress_callback: try: + task_info = tasks.get(task_id, {}) await _progress_callback({ "task_id": task_id, "progress": progress, "message": message, "status": status, + "file": task_info.get("file", ""), "result": result, "error": error, }) diff --git a/backend/static/app.js b/backend/static/app.js index 036c44b..d3b351f 100644 --- a/backend/static/app.js +++ b/backend/static/app.js @@ -147,7 +147,7 @@ class TranscriptionApp { // ===== Tasks / Progress ===== updateTasks(tasks) { tasks.forEach(task => { - this.tasks.set(task.file + '_' + task.started, task); + this.tasks.set(task.task_id, task); }); this.renderTasks(); }