Add library filter, sync, and export enhancements#25
Open
kvmgithub wants to merge 1 commit into
Open
Conversation
Filters support selecting multiple accounts, series, and genres; long option lists collapse behind a Show all row and genres sit above series. Selecting a series no longer returns zero results: the list query referenced a series CTE it never joined, so the filter always errored. Genres were never populated because synced category ladders were not persisted; sync now stores them as JSON name arrays and the genre list reads them via json_each. The account screen can sync all accounts in one run, tapping a library title shows its summary with narrators and owning account, cards show account badges when several accounts exist, the database can be exported and imported as a SQLite file, and library exports offer a Goodreads/ StoryGraph compatible CSV. Refs Promises#23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This PR implements the feature requests from #23 except the additional
provider integrations (Libro.fm, Downpour, Chirp), which are a separate
effort. Along the way it fixes the two bugs behind the filter symptoms
described in the issue: selecting a series after clearing filters showed
zero results, and the genre category was always empty.
Fixes #23
What changed
Filter fixes
referenced a CTE that was never joined in that query, so any series
selection made the whole query fail. The series/category/account
clauses are now built by one shared helper used by both the list and
count queries, and series matching uses an EXISTS over all of a book's
series instead of only the first one.
category_laddersfrom the API but never persisted them. Sync now stores each ladder as a
JSON array of category names in
CategoryLaddersand links it viaBookCategories; the genre list is read back withjson_each. Genresappear after the next library sync.
Filter UI
selected value is shown.
row; selected options stay visible while collapsed.
Multi-account sync
The account screen gains "Sync All Accounts" (shown when more than one
account exists), which syncs every account sequentially with one summary
at the end. Token refresh per account is preserved.
Book details
Tapping a library title opens a detail card with authors, narrators,
series, duration, release date, owning account, and the summary. Long
summaries collapse to 8 lines with Show more/less (shown only when the
text actually exceeds that). Podcast parents open the same card with a
"View Episodes" button, so the episode list is one tap further.
Two data fixes back this up:
publisher_summary(full text) overmerchandising_summary(a teaser truncated with an ellipsis), andupdate_booknow updates the stored description at all — previouslydescriptions were written once at insert and never refreshed.
<p>/<br>structure as paragraphbreaks instead of being flattened to one line.
Account badges
When more than one account exists, library cards show a badge with the
owning account's name next to the existing LibriVox badge.
Database export/import
Settings > Database gains Export (a consistent single-file snapshot via
VACUUM INTO, saved through the system directory picker) and Import(SQLite-header-validated file replaces the current database after a
confirmation).
Goodreads/StoryGraph export
The library export offers a "Goodreads" format: a CSV in Goodreads import
layout (Title, Author, Binding=Audiobook, Year Published, Date Added,
Owned Copies), which StoryGraph's Goodreads importer also accepts.
Audiobooks carry no ISBN, so both services match by title/author.
User-visible behavior
Review focus
queries.rsand the newtest_list_books_with_filters_by_series_and_categorycovering theseries bug, multi-select, and the json_each genre list.
library.rs(link_categories).jni_bridge.rs(legacy single-value fields still accepted).VACUUM INTOexport and the import's header check inSettingsScreen.tsx.Validation
npm run typecheckcargo test -p rust-core(lib + integration suites, all green)filter populated, series selection returns hits, multi-select, detail
card with Show more/less, podcast parent card + episodes, type filter,
database export/import, Goodreads CSV import layout