Collections as device folders, and sync triggers #10

Merged
365DevNet merged 0 commits from refs/pull/10/head into main 2026-07-17 18:45:14 +02:00
365DevNet commented 2026-07-17 18:44:14 +02:00 (Migrated from codeberg.org)

Roadmap items 4 and 5, built together. Everything host-testable is
unit-tested and the ARM app cross-builds clean; device + live-API
verification is pending (see below).

Collections -> device folders

  • New KavitaClient::listCollections + seriesIdsInCollection, verified
    against the server's openapi.json (Kavita 0.9.0.12).
  • core/CollectionFolders maps each series to its alphabetically-first
    collection's sanitised folder (deterministic; no file duplication);
    uncollected books stay at the download-dir root.
  • Books download into downloadDir/<collection>/; detection and unload find
    a book by basename in its folder, the root, or any one-level subfolder, so
    books loaded flat before this change keep working.
  • Progress sync is now subfolder-aware: DeviceReadingDb::readFolder matches
    the folder and anything nested under it (substr prefix, robust to LIKE
    metacharacters; a prefix-sharing sibling like /mnt/ext1/KavitaX is not
    swept in).
  • New DeviceLibrary::listSubdirs.

Sync triggers

  • In-app (built): silent, throttled sync on EVT_NET_CONNECTED and
    EVT_FOREGROUND (WiFi-up / wake while the app is resident). New
    core/SyncThrottle collapses events that fire together; app-open stamps
    the throttle.
  • Background-when-closed (NOT shipped): needs a system hook that fights the
    ~2s suspend and lives in the same firmware system-config class that broke
    the launcher three times. Designed + risks documented in
    docs/device-triggers.md, deliberately not installed.

Verification pending (mine can't cover these)

  • Live API: run scripts/probe.sh against the server to confirm the
    collection endpoints on its version (the probe now lists collections; also
    fixed a pre-existing missing -lsqlite3 link).
  • Device walkthrough: books appear under collection folders in the reader;
    load/unload/progress still work; in-app WiFi-connect/foreground re-sync.

Spec: docs/superpowers/specs/2026-07-17-collections-and-triggers-design.md.
106 -> 120 host tests pass.

🤖 Generated with Claude Code

Roadmap items 4 and 5, built together. Everything host-testable is unit-tested and the ARM app cross-builds clean; device + live-API verification is pending (see below). ## Collections -> device folders - New `KavitaClient::listCollections` + `seriesIdsInCollection`, verified against the server's openapi.json (Kavita 0.9.0.12). - `core/CollectionFolders` maps each series to its **alphabetically-first** collection's sanitised folder (deterministic; no file duplication); uncollected books stay at the download-dir root. - Books download into `downloadDir/<collection>/`; detection and unload find a book by basename in its folder, the root, or any one-level subfolder, so books loaded flat before this change keep working. - Progress sync is now subfolder-aware: `DeviceReadingDb::readFolder` matches the folder and anything nested under it (substr prefix, robust to LIKE metacharacters; a prefix-sharing sibling like `/mnt/ext1/KavitaX` is not swept in). - New `DeviceLibrary::listSubdirs`. ## Sync triggers - In-app (built): silent, throttled sync on `EVT_NET_CONNECTED` and `EVT_FOREGROUND` (WiFi-up / wake while the app is resident). New `core/SyncThrottle` collapses events that fire together; app-open stamps the throttle. - Background-when-closed (NOT shipped): needs a system hook that fights the ~2s suspend and lives in the same firmware system-config class that broke the launcher three times. Designed + risks documented in `docs/device-triggers.md`, deliberately not installed. ## Verification pending (mine can't cover these) - Live API: run `scripts/probe.sh` against the server to confirm the collection endpoints on its version (the probe now lists collections; also fixed a pre-existing missing `-lsqlite3` link). - Device walkthrough: books appear under collection folders in the reader; load/unload/progress still work; in-app WiFi-connect/foreground re-sync. Spec: `docs/superpowers/specs/2026-07-17-collections-and-triggers-design.md`. 106 -> 120 host tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
365DevNet/PocketBook_Kavita_sync!10
No description provided.