diff --git a/docs/library.md b/docs/library.md index 59a8bfe..6444917 100644 --- a/docs/library.md +++ b/docs/library.md @@ -112,6 +112,29 @@ sakral (Religion & Mythologie), spiel (Kinder & Jugend), code (Informatik), typo, wellen, botanik, berge, zellen — and bauhaus when nothing matches. A hash of title and author picks palette, layout and every detail. +### Eingang: books from a cloud folder by themselves (since 2026-10-24) + +A cloud source (Einstellungen → Cloud-Verbindungen, WebDAV: `accounts.WebDAVSource`, +`accounts/webdav.py`) can be marked **Eingang**: its new books come into the library without +anyone importing them. The server can't do it alone — the books are encrypted with the key +on the devices — so a device does: + +1. `static/js/app/57-cloud-inbox.js`: after the book list has loaded (at most every 5 + minutes; only with the real key in `localStorage`, never on diora Reader) it asks + `GET /books/cloud/inbox/` → `{files: [{source, label, path, name, size, modified}], errors}`: + the `.epub`/`.pdf` files of the Eingang sources (three folders deep) no device has taken. + The server claims them for this device for ten minutes (another device asking meanwhile + doesn't get them). +2. Each file: fetched through the server (`/books/cloud//fetch/`), imported like any file + (`_importEbookBuffer`, `skipKnown`: same title and author → left out), then + `POST /books/cloud//done/ {path, result}` with `imported`, `known`, `too_big` (not + offered again) or `failed` (again once the claim ran out). +3. The server keeps them in `accounts.WebDAVSeen` (source, path, size, modified): a file whose + size changed counts as new. The folder itself is never changed. + +The first such source: Shelfmark's e-book downloads on the Hetzner server, served read-only by +dufs (set up by the "Media" session; its notes: `C:\Users\m\homelab-handoff\04-hoerbuecher.md`). + ## Zeitschriften: das Heft und seine Artikel An issue is a unit (the editors' selection and order, its date, its theme) and