diff options
Diffstat (limited to 'audiobook.py')
| -rwxr-xr-x | audiobook.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/audiobook.py b/audiobook.py index 031ae1b..183bdc2 100755 --- a/audiobook.py +++ b/audiobook.py @@ -99,9 +99,12 @@ def _all_models_emit(progress, model_id: str, book_offset: int, Book events are renumbered into the run's global book sequence (BOOK_OFFSET plus the model's own index, GRAND_TOTAL overall) and stamped with the generating model; book_done/book_failed carry the - model too. The per-model "done"/"cancelled" events are swallowed — - the loop emits one merged "done" when every model has run — and - book_done outcomes are counted into COUNTS for that merged event. + model too. Every other converter event (chapter, chunks, chunk_done, + chunk_failed) is stamped with the model as well, so the run view can + attribute e.g. a chunk failure to the model that produced it. The + per-model "done"/"cancelled" events are swallowed — the loop emits one + merged "done" when every model has run — and book_done outcomes are + counted into COUNTS for that merged event. """ def emit(event: dict) -> None: kind = event.get("kind") @@ -116,7 +119,7 @@ def _all_models_emit(progress, model_id: str, book_offset: int, elif kind in ("done", "cancelled"): return else: - progress(event) + progress({**event, "model": model_id}) return emit |
