Repository navigation
feat(genres): canonical book genres in a Calibre custom column - #168
Merged
Merged
Conversation
Calibre tags are freeform, so they make a noisy basis for a genre facet. Genres now live in a `#citadel_genres` multi-value text column (ADR 0006), created only when a user first accepts a genre and never by reads. - libcalibre: set_book_genres / add_book_genres normalize and store genres, list_genres returns them with book counts, and BookQuery can filter by genre. - Metadata providers carry genre candidates separately from subjects. Only Hardcover search genres and MARC 655 genre/form terms count; Open Library subjects and other MARC 6XX fields stay suggestions. - EditBook shows stored genres and provider genre suggestions, with add and add-all. Ported from #153 onto the current main. The OPDS Genres facet from that PR needs the catalog navigation layer, so it moves to the search port. Co-Authored-By: Claude Opus 5.5 <[email protected]>
libcalibre Test Coverage ReportOverall coverage: 80.59% Coverage breakdown available in the artifacts. |
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.
Why
Calibre tags are freeform, which makes them a noisy basis for a genre facet. Citadel wants a small canonical genre list — distinct from tags, and distinct from whatever a metadata provider happens to file under "subject" — that books can be assigned and readers can browse. ADR 0006 has the full reasoning.
This is #153 ported onto current main. The old stack predates the sharing rewrite (#160/#161/#165), so it couldn't be rebased; I carried the feature over by hand.
What changed
#citadel_genrescustom column.set_book_genres/add_book_genresnormalize names,list_genresreturns genres with book counts, andBookQuerycan filter by genre.hardcover:genre) and MARC 655 genre/form terms (marc:655) are authoritative; Open Library subjects and other MARC 6XX fields stay suggestions and are never promoted silently.The column is only created when someone accepts a genre — reads never create schema — so a library shows no genres until the first assignment.
Not in this PR
#153 also filled in the OPDS Genres facet, but that facet lives in the catalog navigation layer from #152, which main doesn't have. It moves to the search/navigation port, which comes next. The ADR is renumbered 0003 → 0006 since 0003 is now the credentials ADR.
Validation
cargo test --workspace(0 failures, including the genre tests in libcalibre and the provider normalization tests),vitest run(250 passed),tsc --noEmitclean.bun lintshows the same 3 warnings as main, in files this doesn't touch.I haven't clicked through the EditBook genre UI in the running app, and
bindings.tsis hand-merged rather than regenerated — it matches the one new command and type, but the first debug run will confirm.