Skip to content

Match release names crediting every co-author - #94

Open
TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/co-author-releases
Open

TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/co-author-releases

Conversation

@TheMightyTRex

Copy link
Copy Markdown

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_authors only 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_release does 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

  • New helper co_author_credits in services/app/domain/release_profiles.py returns 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_authors accepts those combined credits in each of its existing name layouts. A match records every author of the book rather than one.
  • catalog_language_release uses 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

  • New unit tests in tests/unit/test_release_name_identity.py cover 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.
  • Ran every test file that imports release_profiles, plus tests/integration/test_sabnzbd.py and tests/integration/test_prowlarr_sources.py: 531 passed.
  • ruff check and ruff format --check pass.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant