Skip to content

feat(tasks): emit progress events from nine more task handlers#10

Merged
AshDevFr merged 1 commit into
mainfrom
active-tasks
May 4, 2026
Merged

feat(tasks): emit progress events from nine more task handlers#10
AshDevFr merged 1 commit into
mainfrom
active-tasks

Conversation

@AshDevFr
Copy link
Copy Markdown
Owner

@AshDevFr AshDevFr commented May 4, 2026

Wires analyze_series, generate_thumbnails, generate_series_thumbnails, renumber_series_batch, reprocess_series_titles, cleanup_series_exports, scan_library, user_plugin_sync, and the book-mode path of plugin_auto_match to publish TaskProgressEvent so they surface in the "Active Tasks" UI tracker. Previously only refresh_library_metadata and export_series emitted progress, leaving most long-running operations silent in the UI.

For per-row loops (analyze, thumbnails, renumber, reprocess, auto-match) the handlers emit an initial 0/total event followed by current/total updates after each iteration, matching the existing refresh_library_metadata pattern.

For scan_library, SharedScanState gains an optional task_id + broadcaster so every existing send_progress() call site also publishes a TaskProgressEvent (files_processed/files_total with series and book counts in the message). scan_library() takes a new task_id parameter; existing test call sites pass None.

cleanup_series_exports and user_plugin_sync use phase-based progress (3 and 4 phases respectively) since they have no single dominant per-row loop. Users see meaningful "Pulling…", "Pushing…", "Sweeping stale .tmp files…" messages instead of nothing.

Wires analyze_series, generate_thumbnails, generate_series_thumbnails,
renumber_series_batch, reprocess_series_titles, cleanup_series_exports,
scan_library, user_plugin_sync, and the book-mode path of
plugin_auto_match to publish TaskProgressEvent so they surface in the
"Active Tasks" UI tracker. Previously only refresh_library_metadata and
export_series emitted progress, leaving most long-running operations
silent in the UI.

For per-row loops (analyze, thumbnails, renumber, reprocess, auto-match)
the handlers emit an initial 0/total event followed by current/total
updates after each iteration, matching the existing
refresh_library_metadata pattern.

For scan_library, SharedScanState gains an optional task_id +
broadcaster so every existing send_progress() call site also publishes
a TaskProgressEvent (files_processed/files_total with series and book
counts in the message). scan_library() takes a new task_id parameter;
existing test call sites pass None.

cleanup_series_exports and user_plugin_sync use phase-based progress
(3 and 4 phases respectively) since they have no single dominant
per-row loop. Users see meaningful "Pulling…", "Pushing…",
"Sweeping stale .tmp files…" messages instead of nothing.
@AshDevFr AshDevFr merged commit f0b0952 into main May 4, 2026
17 checks passed
@AshDevFr AshDevFr deleted the active-tasks branch May 4, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant