Skip to content

Recognise "Series by" and "Books 1 to 5" release names as collections - #95

Open
TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/series-pack-names
Open

TheMightyTRex wants to merge 1 commit into
logabell:mainfrom
TheMightyTRex:contrib/series-pack-names

Conversation

@TheMightyTRex

Copy link
Copy Markdown

Problem

Automatic selection keeps series packs away from single book requests by checking release names against the PACK pattern in services/app/domain/automatic_eligibility.py. The pattern only recognises a numbered range written with a dash, such as "Books 1-5". Common indexer names such as "The Long Earth Series By Stephen Baxter and Terry Pratchett" or "The Long Earth series, books 1 to 5" are not recognised, so an automatic grab can take a whole series pack for one book.

Change

The PACK pattern now also matches:

  • "series by", as in "The Long Earth Series By ..."
  • a numbered range written with "to", as in "books 1 to 5"

The pattern is shared, so the same names are also treated as collections where PACK is used during import and in the possible collection flag on book sources.

Testing

  • New unit test test_whole_series_names_are_collections in tests/unit/test_pack_coverage.py covers both name forms. It fails without the change.
  • Ran every test file that refers to automatic_eligibility, automatic_selection or collection_candidate (42 files, unit and integration): 784 passed.
  • ruff check and ruff format --check pass.

🤖 Generated with Claude Code

Automatic selection keeps series packs away from single book requests
by matching release names against PACK, which only knew a numbered
range written with a dash ("Books 1-5"). Names such as "The Long Earth
Series By Stephen Baxter and Terry Pratchett" or "The Long Earth
series, books 1 to 5" were taken for one book, so an automatic grab
could pick a whole pack.

Match "series by" and numbered ranges written with "to" as well.

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