Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/app/domain/automatic_eligibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
PARTIAL = re.compile(r"\b(?:sample|excerpt|preview|incomplete|truncated)\d*\b", re.I)
DISC_FOLDER = re.compile(r"(?:^|[\s_(\[])(?:cd|disc|disk|part)\s*\d+\b", re.I)
PACK = re.compile(
r"\b(collection|pack|omnibus|box[ -]?set|anthology|complete series|"
r"books?\s+\d+\s*[-–]\s*\d+)\b",
r"\b(collection|pack|omnibus|box[ -]?set|anthology|complete series|series by|"
r"books?\s+\d+\s*(?:[-–]|to)\s*\d+)\b",
re.I,
)

Expand Down
15 changes: 15 additions & 0 deletions tests/unit/test_pack_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,18 @@ def test_target_format_preference_cannot_be_satisfied_by_a_siblings_encoding():
descriptor=files,
catalog=CATALOG,
)


@pytest.mark.parametrize(
"title",
[
"The Long Earth Series By Stephen Baxter and Terry Pratchett",
"The Long Earth series, books 1 to 5 - Terry Pratchett & Stephen Baxter",
],
)
def test_whole_series_names_are_collections(title):
work = {"title": "The Long Earth", "authors": ["Terry Pratchett", "Stephen Baxter"]}
value = release().model_copy(
update={"title": title, "raw_title": title, "authors": work["authors"]}
)
assert collection_candidate(value, work)