stream auto review progress over SSE so large inboxes don't feel frozen
Build and Push Docker Image / build (push) Successful in 1m18s

sortInbox is now async, yields every 10 items, and emits inbox_sort_start
+ inbox_sort_progress via optional hooks. the pipeline route handler
wires those hooks to the existing job events stream and guards against
a second concurrent sort with a 409.

the inbox column swaps its Auto Review button for a live "Sorting N/T"
counter and progress bar while the sort is in flight; the auto-process
toggle hides to give the progress the full subtitle line. the previous
behaviour was a frozen button for the entire duration of the sort.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 20:56:51 +02:00
parent 76a16ba84c
commit a21bcefb54
8 changed files with 176 additions and 41 deletions
+5 -2
View File
@@ -419,8 +419,11 @@ async function runScan(limit: number | null = null): Promise<void> {
if (getConfig("auto_processing") === "1") {
const { sortInbox, getAudioLanguages } = await import("./review");
const { emitInboxSorted } = await import("./execute");
const result = sortInbox(db, getAudioLanguages());
const { emitInboxSorted, emitInboxSortStart, emitInboxSortProgress } = await import("./execute");
const result = await sortInbox(db, getAudioLanguages(), {
onStart: emitInboxSortStart,
onProgress: emitInboxSortProgress,
});
emitInboxSorted(result);
}
}