Repository navigation
Group library series and authors whose names differ only in punctuation - #91
Open
TheMightyTRex wants to merge 1 commit into
Open
TheMightyTRex wants to merge 1 commit into
TheMightyTRex wants to merge 1 commit into
Conversation
My Library's Series and Authors tabs grouped by the lowercased name with spaces collapsed, so "Discworld: Industrial Revolution" and "Discworld - Industrial Revolution" became two cards, as did "The Silver Ships" and "Silver Ships", or "J.R.R. Tolkien" and "J. R. R. Tolkien". Groups now share a key that ignores case and punctuation (and treats "&" as "and"); series also ignore a leading "The" and a trailing "Series". Opening a group computes the same key from the name it was given, so a merged card lists the books from every spelling. Search still matches the names as written, and a matching group keeps its full book count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
My Library's Series and Authors tabs group books by the name in lower case with spaces collapsed. When the same series or author is spelt slightly differently by different sources, the library shows separate cards for what is one series or one person. For example:
Change
services/app/api/library_groups.py:/api/library/groups/{kind}/books?name=..., which the web app calls with thegroupURL parameter) builds the same key from the name it receives, so a merged card lists the books from every spelling, whichever spelling is passed.The card shows one of the spellings as its name, as before. The web app needs no change: it passes the card's name back to open the group, and uses
keyonly to tell cards apart.Testing
tests/integration/test_library_groups.pycovering the series cases above, an author spelt two ways, search by one spelling, and opening a merged group by either spelling.tests/integration/test_library_groups.pyandtests/integration/test_library_projection_scaling.py: 13 passed.ruff checkandruff format --checkpass.🤖 Generated with Claude Code