sse: broadcast inbox_sorted on distributor runs

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 10:40:19 +02:00
parent 6faa5986a3
commit 43b190a1a0
2 changed files with 6 additions and 3 deletions
+5
View File
@@ -139,6 +139,11 @@ function emitJobProgress(jobId: number, seconds: number, total: number): void {
for (const l of jobListeners) l(line);
}
export function emitInboxSorted(result: { moved_to_queue: number; moved_to_review: number }): void {
const line = `event: inbox_sorted\ndata: ${JSON.stringify(result)}\n\n`;
for (const l of jobListeners) l(line);
}
/** Parse "Duration: HH:MM:SS.MS" from ffmpeg startup output. */
function parseFFmpegDuration(line: string): number | null {
const match = line.match(/Duration:\s*(\d+):(\d+):(\d+)\.(\d+)/);