diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-30 16:31:34 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-30 16:31:34 +0200 |
| commit | 854b76338072979526ce36fbc176c82f6fc5d0bd (patch) | |
| tree | 6db723f22ba49b892f07942ea93d04076d0f72fe /packages/meshbay-node/tests/test_title_parse.py | |
| parent | 4b64ba2513d3985c843167153311436a80474149 (diff) | |
| download | meshbay-854b76338072979526ce36fbc176c82f6fc5d0bd.tar.gz | |
fix(node): stop a numbered saga all matching its first film
Every "<Saga> Episode <N> - <subtitle>" file in a numbered franchise
resolved to the series' first entry (a real, older film). `sequel_variants`
stripped "Episode <N>" and offered the bare "<Saga>" as a candidate query;
that matches the first film's original_title at ratio 1.0 and beat PASS 1's
correct-but-lower hit. A franchise's bare name is very often a real,
different film.
When a Part/Episode/Chapitre/… keyword carried the index, sequel_variants
no longer emits the bare base — only "<base> <digit>" and "<base> <roman>".
Without a keyword ("<Franchise> 3") the bare base is still offered, so that
fix is untouched. Verified live against TMDB: the franchise's episodes each
resolve to their own entry; the earlier numbered-sequel, two-part-film and
franchise-subtitle regressions all hold.
docs/mediacenter.md §10.3.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BMLQjqFGCize2KtNBT79v
Diffstat (limited to 'packages/meshbay-node/tests/test_title_parse.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_title_parse.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/meshbay-node/tests/test_title_parse.py b/packages/meshbay-node/tests/test_title_parse.py index 045635f..56f4e20 100644 --- a/packages/meshbay-node/tests/test_title_parse.py +++ b/packages/meshbay-node/tests/test_title_parse.py @@ -80,16 +80,27 @@ def test_sequel_variants_roman_numeral_offers_the_digit_form(): assert "Old Frontier 3" in v -def test_sequel_variants_strips_a_part_keyword_wrapper(): +def test_sequel_variants_rewrites_a_part_keyword_index_but_keeps_the_name(): + # §10.1/V14: with a "Part"/"Episode"/… keyword the bare base is + # withheld — "Some Saga" alone collides with a franchise-origin film. v = sequel_variants("Some Saga Part 2") - assert "Some Saga" in v assert "Some Saga II" in v + assert "Some Saga 2" in v + assert "Some Saga" not in v def test_sequel_variants_reads_a_spelled_out_index(): v = sequel_variants("Story Chapter Three") - assert "Story" in v assert "Story 3" in v and "Story III" in v + assert "Story" not in v # keyword present -> no bare base + + +def test_sequel_variants_star_wars_shape_does_not_offer_the_bare_franchise(): + # Every "<Franchise> Episode <N>" was matching the 1977 original + # because the "Franchise" variant hit it at ratio 1.0 (§10.1/V14). + v = sequel_variants("Star Wars Episode III") + assert "Star Wars" not in v + assert "Star Wars 3" in v def test_sequel_variants_ignores_a_trailing_word_that_is_not_an_index(): |