diff options
| author | historia <historiavg@proton.me> | 2026-09-01 14:32:05 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-01 14:32:05 -0400 |
| commit | 6cfcd564c0684c52618235e6366f4a81c02b9a5b (patch) | |
| tree | 55321760a8103bc6b5d79489fac4135a60e6e3ba /audiobook.py | |
| parent | dc6e7cd43029da62dabe2513fb5aa8a34df1bd6d (diff) | |
| download | tts-audiobook-generator-6cfcd564c0684c52618235e6366f4a81c02b9a5b.tar.gz | |
slop refactor/dedup
Diffstat (limited to 'audiobook.py')
| -rwxr-xr-x | audiobook.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/audiobook.py b/audiobook.py index 183bdc2..b881b6e 100755 --- a/audiobook.py +++ b/audiobook.py @@ -209,8 +209,15 @@ def _convert_each_model(*, backend: str, model_ids: list, model_voices: dict, converter._book_files = book_files converter._planned = planned ok = converter.run() - model_ok = counts["ok"] if progress is not None \ - else (len(planned) if ok else 0) + if progress is not None: + model_ok = counts["ok"] + else: + # A failed book aborts the rest, but the books that + # succeeded before it still count (run() returns False + # for the whole model either way). + model_ok = sum( + 1 for success in getattr(converter, "results", {}).values() + if success) except KeyboardInterrupt: print("\n[WARNING] Shutdown requested by user") return 130 |
