fix: resolve file paths and stream the multi-book zip download

file.path is relative to book.path, so the archive matched nothing on disk and
came out empty. Also namespace entries per book to stop filename collisions, and
stream the zip instead of buffering it whole.
This commit is contained in:
2026-08-12 15:17:48 -04:00
parent 540522e828
commit bd8d68b9ba
3 changed files with 146 additions and 16 deletions
+7
View File
@@ -369,6 +369,13 @@ async def test_create_multiple_books_from_directory(
assert len(data.get("items") or data.get("data")) >= 1
# NOTE: the multi-book ZIP download is covered at the service level, in
# tests/unit/test_services/test_book_service.py. Driving `/books/download` through
# AsyncTestClient hangs in fixture teardown: it is the only `Stream` endpoint in the
# app, and the test transport never sends the `http.disconnect` that Litestar's
# streaming response waits on, so the app's lifespan shutdown never completes.
# async def test_delete_book_metadata(authenticated_client: AsyncClient) -> None:
# raise NotImplementedError()