feat: import a Calibre library

Reads metadata.db and copies the books into a library — from a zip uploaded on
the library settings page, or from a path with `litestar calibre-import`. The
source is never touched, and re-running only picks up what is new.

Also names the formats mimetypes does not know: a Calibre library is full of
MOBI and AZW3, and a null content type used to fail the book endpoint.
This commit is contained in:
2026-08-17 13:38:44 -04:00
parent 85367daf7e
commit 55e00ba960
34 changed files with 4723 additions and 50 deletions
+4
View File
@@ -242,6 +242,10 @@ so the whole file sits in the node process, per concurrent reader, and the brows
nothing until it completes. Passing `response.body` straight through restores the stream
and is a small change.
This is now **responses only**. The request side was fixed for the Calibre archive upload,
which cannot be held in memory: POST and PATCH pass `request.body` through with
`duplex: 'half'` (`bodyOf` in the same file). The response side is the same shape of fix.
**Range.** The proxy forwards only `Content-Type`, `Content-Disposition` and
`Content-Length`. It never sends the client's `Range` upstream, and would drop
`Accept-Ranges` and `Content-Range` coming back — a 206 without `Content-Range` is