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."""
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,
})

View File

@ -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();
}