Repository navigation
fix: ranking treats text after ". " or " - " in a request title as an optional subtitle - #494
Merged
Merged
Conversation
…an optional subtitle (#466) The request title's subtitle split now also happens at a dash with spaces on both sides and at ". " after a number or a word of four or more letters, exactly like the colon. A series position before the split is left out of the coverage count. For a request split this way, a release " - " after the main part that names another subtitle no longer counts as a complete title, so a different book of the same series or author loses to the requested one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the release names another (#466) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…466) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # documentation/phase3/ranking-algorithm.md
…release carries the subtitle (#466) A release with neither the position nor the subtitle (often book 1, named after the series) no longer clears word coverage for book N. A dash or dot request also tries the full title without brackets again, as main did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers " - " only (#466) 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.
Closes #466
What changed
splitSubtitle(),src/lib/utils/match-normalize.ts): in the request title, text after the first:, a dash with spaces on both sides (-, or an en or em dash written the same way) or.is an optional subtitle, the way text after a colon already was. The words before the split stay required..splits only after a number or a word of four or more letters, so initials (A. J. Fikry) and short abbreviations (Mr. Mercedes,Dr.,St.,Vol.) don't split, and neither doProf.,Capt.,Corp.,Dept.,Bros.andHrsg.. A hyphen inside a word (Spider-Man) never splits.scoreMatch,src/lib/utils/ranking-algorithm.ts): a bare number right before the split ("Die Tribute von Panem 1. Tödliche Spiele") was already not a required number (fix: automatic search stops grabbing the wrong book (stricter title and author matching) #459). It is now also left out of the 80% word-coverage count, but only when the release carries at least half of the subtitle words. A release that leaves out both the number and the subtitle is often another volume named after the series (book 1 of a LitRPG series usually goes by the bare series name), so there the number still counts as missing, as onmain:Zogarth - The Primal Hunter [M4B]scores 0 for "The Primal Hunter 3: A LitRPG Adventure", in any split form, with or without the catalog series part. When the release names another position (a G4c conflict), the number counts as missing too. So in both search modesPrimal.Hunter.T02…still scores 0 for "Primal Hunter 1. …", and so does the colon form.dashNamesOtherSubtitle(),src/lib/utils/match-gates.ts): this applies to a request split at-or.when only its main part is found in the release. A-after that part now counts as the end of the title only when what follows is the request's own subtitle (the G1 rule), an author, or only volume words and numbers. For "Sherlock Holmes - Der Hund der Baskervilles",Arthur Conan Doyle - Sherlock Holmes - Das Zeichen der Vierused to tie the right release at 60 and now scores 40.7 (fuzzy). A request split at a colon keeps the plain-rule. The check covers a release-only: a different book in brackets, after a comma orby, or the series name alone still ties (see Risk).-or.still tries its full title without brackets before the split, asmaindid. "Die Tribute von Panem 1. Tödliche Spiele (ungekürzt)" vsDie Tribute von Panem 1. Tödliche Spiele - Suzanne Collins [MP3]stays 60 (it would have dropped to 47).colonSubtitleAgreesshares its agreement check with the new helper. Its behaviour is unchanged.documentation/phase3/ranking-algorithm.md(Stage 1 optional parts, Stage 2 complete title, Fixed Issues) anddocumentation/phase3/match-gates.md(G1, G4a).Why
Only brackets and a colon made a subtitle optional. Audible titles from French and German catalogs often write the subtitle after
.or-("Primal Hunter 1. Une aventure de LitRPG", "C'était ça ou mourir - Prix du Roman FNAC 2026"). The subtitle words were then required, the release names leave them out, and word coverage scored those releases 0 in both search modes.The apostrophe half of #466 was already fixed on
mainby the apostrophe fold (foldApostrophes). Those rows score as the same title written without the apostrophe, so this branch doesn't touch apostrophes oraudible-series-rank.ts.Evidence
The six #466 rows (matchScore, French config for the French rows, both search modes):
A release with neither the series position nor the subtitle (matchScore, automatic search; interactive is the same):
Zogarth - The Primal Hunter [M4B]The.Primal.Hunter.Zogarth.M4BJF Brink - Defiance of the Fall [M4B]Casualfarmer - Beware of Chicken [M4B]Zogarth - The Primal Hunter [M4B]Primal.Hunter.Zogarth.2024.FR.[MP3]Joseph Heller - Catch Me [MP3]Jim Lovell - Apollo [MP3]tests/utils/ranking-subtitle-split.test.tsruns the realrankTorrents():-;Der Herr der Ringe. …,Sherlock Holmes - …) or an author name (Terry Pratchett - Mort) before the split, against a release naming another book of that series or author: the requested release ranks first with a higher matchScore, in both modes;T02,Primal Hunter 2 - Zogarth) scores 0 in both modes;Die Tribute von Panem 1. …,Throne of Glass 1 - …) still clear 50;.score as onmain;Zogarth - The Primal Hunter 3 [M4B]ranks first above 50 while the bare series name scores 0;splitSubtitleintests/utils/match-normalize.test.ts,dashNamesOtherSubtitleintests/utils/match-gates.test.ts.main'ssrc(d8011ab) and this branch's tests: 28 failed, 219 passed. The 9 ranking behaviour tests fail on an assertion. The 19 helper unit tests fail because the helpers didn't exist yet. The other 25 pass onmainby design: the 8 apostrophe-row tests (already fixed there), the 10 wrong-book tests (there the subtitle words are required, so the wrong release already scored 0), the 2 fix: automatic search stops grabbing the wrong book (stricter title and author matching) #459 rows and the 5 unchanged-title pins. The 19 tests added for the wrong-volume rows and the bracketed Panem title pass onmainand failed on an assertion before the subtitle check and the bracket-free title (47.3 instead of 0, 47 instead of 60).tests/utils/fixtures/ranking-oracle-223.jsonandranking-right-books-223.jsonwas scored onmain(64df2b1) and on this branch (562 scores; the right-books rows in both modes). All are identical.Checks
vitest relatedon the three changedsrcfiles plus the three test files): PASS, 125 files, 2511 teststsc --noEmitclean; ESLint reports nothing in the six touched files)src/apporsrc/componentsRisk and rollback
.change. Titles with brackets only, or no split, score as before. A colon title changes in one case: a bare series position right before the colon, against a release that leaves the number out but carries at least half of the subtitle words, now clears word coverage (onmainit scored 0).-, or another volume, it still loses to the requested book. A scene name that only reaches a fuzzy match can still clear the automatic threshold when the requested release is missing. For "Sherlock Holmes - Der Hund der Baskervilles",Sherlock.Holmes.Eine.Studie.in.Scharlachrot.Arthur.Conan.Doyle.MP3scores 32 (total 57). The colon form of that title scores it the same onmain.-only. For "Sherlock Holmes - Der Hund der Baskervilles",Sherlock Holmes (Das Zeichen der Vier) - Arthur Conan Doyle,Sherlock Holmes [Das Zeichen der Vier] …,Sherlock Holmes by Arthur Conan Doyle - Das Zeichen der Vier,Sherlock Holmes, Das Zeichen der Vier - …and the series name alone (Arthur Conan Doyle - Sherlock Holmes) score 60 and tie the right release; so do the same shapes for "Der Herr der Ringe. Die Gefährten". They scored 0 onmain, and the colon form of both titles scores every one of them 60 onmain. Seeders and size then decide.-rule. Onmain, "Sherlock Holmes: Der Hund der Baskervilles" ties… - Sherlock Holmes - Das Zeichen der Vierat 60, and this branch leaves that unchanged.Release note
🤖 Generated with Claude Code