Fix task queue display: consistent task_id keys in frontend, add file field to WebSocket progress

This commit is contained in:
keboss-m 2026-06-01 10:24:19 +03:00
parent e5a3927819
commit 932dc71b8a
2 changed files with 3 additions and 1 deletions

View File

@ -39,11 +39,13 @@ async def _send_progress(task_id: str, progress: int, message: str, status: str,
"""Отправляет прогресс через callback.""" """Отправляет прогресс через callback."""
if _progress_callback: if _progress_callback:
try: try:
task_info = tasks.get(task_id, {})
await _progress_callback({ await _progress_callback({
"task_id": task_id, "task_id": task_id,
"progress": progress, "progress": progress,
"message": message, "message": message,
"status": status, "status": status,
"file": task_info.get("file", ""),
"result": result, "result": result,
"error": error, "error": error,
}) })

View File

@ -147,7 +147,7 @@ class TranscriptionApp {
// ===== Tasks / Progress ===== // ===== Tasks / Progress =====
updateTasks(tasks) { updateTasks(tasks) {
tasks.forEach(task => { tasks.forEach(task => {
this.tasks.set(task.file + '_' + task.started, task); this.tasks.set(task.task_id, task);
}); });
this.renderTasks(); this.renderTasks();
} }