Enables interactive book selection via --select #49
No files matched your search
+4
-1
@@ -8,7 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
`unsafe_ask()`. Row format: `N. Title — Author [Series #N]`.
|
- **selector:** Add interactive book selection module `selector.py` with
|
||||||
|
`select_books()` (questionary checkbox prompt, confirmation summary) and
|
||||||
|
`_format_row()` helper. Uses `unsafe_ask()` for Ctrl+C propagation.
|
||||||
|
Row format: `N. Title — Author [Series #N]`.
|
||||||
9 tests. Closes #47.
|
9 tests. Closes #47.
|
||||||
- **sync_run:** Wire `--select` into download pipeline. TTY guard
|
- **sync_run:** Wire `--select` into download pipeline. TTY guard
|
||||||
(non-interactive terminals get error exit 1), dict→Book conversion
|
(non-interactive terminals get error exit 1), dict→Book conversion
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def _download_one(
|
|||||||
|
|
||||||
|
|
||||||
def download_all_books(
|
def download_all_books(
|
||||||
raw_books: list[dict],
|
raw_books: list[dict | Book],
|
||||||
*,
|
*,
|
||||||
workers: int,
|
workers: int,
|
||||||
download_fn: Callable[[Book], Any],
|
download_fn: Callable[[Book], Any],
|
||||||
@@ -99,7 +99,7 @@ def download_all_books(
|
|||||||
"""Run downloads for all books using a thread pool.
|
"""Run downloads for all books using a thread pool.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
raw_books: List of raw Libro.fm API book dicts.
|
raw_books: List of raw Libro.fm API book dicts, or pre-converted Book objects.
|
||||||
workers: Number of parallel worker threads.
|
workers: Number of parallel worker threads.
|
||||||
download_fn: Callable accepting a Book, returning Path (success) or None (skipped).
|
download_fn: Callable accepting a Book, returning Path (success) or None (skipped).
|
||||||
reporter: Reporter instance with start_download/complete/fail/summary methods.
|
reporter: Reporter instance with start_download/complete/fail/summary methods.
|
||||||
|
|||||||
Reference in new issue
Block a user