feat(sync_run): wire --select into download pipeline
Replace select_mode stub with real selection pipeline: - TTY guard: non-interactive terminals get fatal_error exit - Convert filtered dicts to Books via from_library_row() - Call select_books(), pass selected Books to orchestrator - Orchestrator accepts pre-converted Book objects (isinstance check) - --limit bypassed when --select is active, with verbose note - Remove "[not implemented]" from --select help text Closes #48
This commit is contained in:
1 parent
0d555e4628
commit
fa1543e3d7
9 files changed
+306
-22
No files matched your search
@@ -113,10 +113,15 @@ def download_all_books(
|
||||
if not raw_books:
|
||||
return OrchestratorResult()
|
||||
|
||||
# Convert raw dicts to Book objects, preserving order and index
|
||||
books_with_index: list[tuple[int, Book]] = [
|
||||
(i, from_library_row(raw)) for i, raw in enumerate(raw_books)
|
||||
]
|
||||
# Convert raw dicts to Book objects, preserving order and index.
|
||||
# Accept pre-converted Book objects directly to avoid double-conversion
|
||||
# when select mode has already called from_library_row().
|
||||
books_with_index: list[tuple[int, Book]] = []
|
||||
for i, raw in enumerate(raw_books):
|
||||
if isinstance(raw, Book):
|
||||
books_with_index.append((i, raw))
|
||||
else:
|
||||
books_with_index.append((i, from_library_row(raw)))
|
||||
|
||||
downloaded_count = 0
|
||||
skipped_count = 0
|
||||
|
||||
Reference in new issue
Block a user