Your library now lives on your device
This beta changes how Hardcover Sync gets its data.
Until now, most screens downloaded everything again each time they opened, even when nothing had changed, and lists did not work offline at all. From this version the plugin keeps your library on the device and asks Hardcover only what changed. Anything that hasn't changed opens from the device with no download at all.
Lists are the first part. Shelves, covers and a "Download for offline" option follow in the next betas.
What's new
- Every list is kept on your device, yours and the ones you follow, even ones you have never opened.
- Home checks them each time it opens, inside the request it was already making for the "More lists" tile.
- Only lists that changed are downloaded.
- Lists work offline. The lists screen, every list and every book on them open instantly with no connection.
- That includes each book's full synopsis. Shelves still keep only the first 600 characters.
- Books you open online are kept as well, so they open offline with everything their details showed.
- An unchanged list costs nothing. Opening it makes no request at all.
- A list that changed downloads only which books it holds, plus the books the device doesn't have yet. It no longer downloads the whole list again.
- A book that is on several lists is stored once.
- Refresh in a list's menu (top left) downloads it again in full, if anything ever looks out of date.
- List book counts are now counted, rather than read from a stored number that can be off by one.
Measured on a real account (9 lists, 61 books)
| Before | Now | |
|---|---|---|
| Opening a list that hasn't changed | the whole list, every time | no request |
| A 25-book list that gained one book | ~32 KB | ~3 KB |
| Checking all 9 lists for changes | — | one request, ~1 KB |
| Lists, books and synopses offline | not available | everything, no request |
| Space on the device | — | 160 KB for the whole library |
The first Home open after updating saves every list in the background (91 KB on this account). After that, only changes are downloaded.
Under the hood
- Storage: a small database,
hardcoversync_library.sqlite3in KOReader's settings folder. It uses the SQLite that KOReader already ships, and signing out clears it. - Lists: each saved list holds only which books are on it. The books themselves are stored once each.
- Change check: each list carries a fingerprint, made of when Hardcover last changed it and how many books it holds. If the fingerprint hasn't moved, the saved copy is still right.
- Downloads: all list downloads run one at a time in a single background queue, so they never compete with each other.
- Testing: tested against the real Hardcover API as well as the plugin's test suite and emulator.
Please test
- Open Home once while online, then turn on airplane mode and browse your lists and their books.
- If you follow very large lists, the first Home open after updating has more to download. It runs in the background.
- Known: reordering a ranked list on the website may not show up until you tap Refresh. This is still being confirmed.
- If anything looks stale, tap Refresh and please report it.
What's Changed
- Bring 1.6.3-beta.3 into main: update-check fixes and changelog by @CaptainCamin in #48
- Order hardcover_api.lua by area, async wrappers last by @CaptainCamin in #49
- Release 1.6.3 by @CaptainCamin in #50
- theme.lua: pill buttons, serif headings, solid black progress bars, hatching and icon helpers by @CaptainCamin in #51
- Bundle plugin icons by @CaptainCamin in #52
- Beta 1.7.0-beta.1: lists kept on the device by @CaptainCamin in #54
Full Changelog: v1.6.3-beta.3...v1.7.0-beta.1