Repository navigation
Match release names crediting every co-author - #94
Open
TheMightyTRex wants to merge 1 commit into
Open
TheMightyTRex wants to merge 1 commit into
TheMightyTRex wants to merge 1 commit into
Conversation
Indexer names for co-written books often credit all authors before or after the title, such as "Terry Pratchett & Stephen Baxter - The Long Earth". The author/title check only knew single authors, so these releases failed identity and were held for review, and a language after the title was not inferred. Accept every catalog author together, in any order, joined by spaces, "and" or "&", as one credit for books with two or three authors. A match records all of the authors. A different co-author or title still does not match. 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
Indexers usually name co-written books with every author, for example "Terry Pratchett & Stephen Baxter - The Long Earth" or "The Long Earth - Terry Pratchett & Stephen Baxter". The author and title check in
indexer_title_authorsonly compares the release name with one catalog author at a time, so these names never match. The release cannot be confirmed as the book and the download is held for review, even though the name states the book and its authors exactly.The same gap means
catalog_language_releasedoes not find the end of the catalog title and author in these names, so a language stated after the title (for example "German Hoerbuch") is not picked up.Change
co_author_creditsinservices/app/domain/release_profiles.pyreturns every catalog author together, in any order, joined by spaces, "and" or a comma, after the usual normalisation (which also turns "&" into a space). It only applies to books with two or three authors, to keep the number of combinations small.indexer_title_authorsaccepts those combined credits in each of its existing name layouts. A match records every author of the book rather than one.catalog_language_releaseuses the same combined credits when it looks for the title and author boundary.A release naming a different co-author, or a different title, still does not match.
Testing
tests/unit/test_release_name_identity.pycover the combined credits, four co-author name layouts, a different co-author or title not matching, and language inference after a co-author credit. The matching and language tests fail without the change.release_profiles, plustests/integration/test_sabnzbd.pyandtests/integration/test_prowlarr_sources.py: 531 passed.ruff checkandruff format --checkpass.🤖 Generated with Claude Code