Two bugs found by code review:
1. Progress bar exceeds 100% on resumed downloads because
Content-Length from a Range response covers only remaining
bytes. Now adds resume_from for the true total.
2. session.transport reached into httpx.Client._transport, a
private attribute that may break on httpx upgrades. Transport
is now stored at construction time instead.
Add @property transport getter that returns the underlying httpx
transport, replacing the single call site in downloader.py that
reached through session._client._transport. Encapsulates private
attribute access behind a public interface. 2 new tests.
Closes#38
Relocate API client from client.py to session.py with constructor
injection. Transport is now passed once at construction time
instead of per-method, eliminating 5 redundant httpx.Client
creations per session lifecycle.
- New session.py: LibroFmSession with shared _client, transport
injected at construction, auth headers set once after
authenticate()
- Old client.py: deprecated re-export shim (LibroFmClient alias)
- All endpoint signatures slimmed to ≤3 params (removed
transport= from authenticate/fetch_library/fetch_m4b_url/
fetch_download_manifest/fetch_pdf_extra_url)
- Updated all source imports (cli.py, downloader.py) and test
files (test_client, test_downloader, test_cli, test_progress)
- 17 new TDD tests in test_session.py
Closes#27