feat(downloader): wire rename_chapters into download pipeline

_download_mp3() returns (output_dir, tracks) tuple so manifest
track data flows to callers. download_book() accepts rename_chapters
kwarg; after MP3 extraction succeeds, calls rename_chapters() via
_rename_and_log() helper which also reports to user via reporter.

Both PlainTextReporter and RichProgressReporter show visible feedback:
'Renamed N chapter(s) for Book → example.mp3'. sync_run.py closure
threads resolved_rename_chapters flag through to download_book().

6 new integration tests covering all format strategies and edge cases.
~229 total tests. Closes #34.
This commit is contained in:
AlexKucera committed 2026-06-05 17:47:10 +02:00
1 parent af5ad4953c
commit a415fc37f5
7 files changed
+490 -17

No files matched your search

+9 -1
View File
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8:6af|## [Unreleased]
## [Unreleased]
### Added
@@ -19,6 +19,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
and `sync_run()` resolution (CLI True → config value). 5 new tests, 223 total.
Closes #33.
- **downloader:** Wire `rename_chapters()` into download pipeline.
`_download_mp3()` returns `(output_dir, tracks)` tuple; `download_book()`
accepts `rename_chapters` kwarg; new `_rename_and_log()` helper calls rename
and reports via `reporter.chapter_renamed()`. Both reporters show visible
feedback: "Renamed N chapter(s) for 'Book' → 'example.mp3'".
`sync_run.py` closure threads resolved flag through to `download_book()`.
6 new integration tests, ~229 total. Closes #34.
### Refactored
- **session:** Rename LibroFmClient → LibroFmSession, relocate to