You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(audiobooks): keep an untagged book unmatched on a partial title match - #4151
Other clients: Apple, Android and Roku N/A. The change is in server-side enrichment; clients show whatever metadata the server stores.
Audiobook enrichment gave an untagged book another, real book's author, narrators, cover, summary and runtime when the titles shared a word or two. TitleScore scores a one-word prefix of a two-word title at 0.667, above the 0.5 bar ("Raw Stream" against "Raw"). AuthorsAgree treats a missing item author as agreement, so nothing contradicted the match. The item then stopped showing as unmatched.
This PR has no dependencies and can merge in any order.
Approach
SearchMatchAdmissionRequest gets NoAuthor. The audiobook enricher sets it when the item's author is empty (internal/audiobooks/enrichment.go).
With NoAuthor set, AdmitSearchMatch filters the provider's results before ranking them (titleOnlyCandidates in internal/metadata/match_admission.go). A result stays when one of its titles (primary, original, or an alias) identifies the book on its own, or when it carries an ID the item already holds under the same provider.
A title identifies the book (titleAloneIdentifies in internal/metadata/match_confidence.go) when both titles have the same words in any order, ignoring stopwords such as "the" and "and", or when one title's words all appear in the other and the shorter title is at least 12 characters. That is the floor the existing containment rule uses. A volume word before a number ("Series 2", "Book 2") is ignored, because ranking already rejects a volume that disagrees.
So "Raw" for "Raw Stream", "Dune" for "Dune Messiah", "Dune Messiah" for "Dune" and "The Book of Unknown Americans" for "Unknown Author Book" are refused. The book keeps its filename title and stays unmatched for an admin to match by hand. Folder titles with an author or series prefix ("Andy Weir - Project Hail Mary"), "Pride & Prejudice", and every correct pair in the production calibration table still match.
minTitleScore and AuthorsAgree are unchanged, as the issue asked. Books with an author, ebooks, manga, movies and series admit matches as before.
Validation
gofmt, go vet and the changed-lines lint are clean.
TestAdmitSearchMatchWithoutAnAuthorNeedsTheTitleToIdentifyTheBook covers the issue's pairs in both directions, an author-prefixed folder, an ampersand, a dropped leading article ("Hobbit" for "The Hobbit"), a candidate carrying the item's own ID, one beside another provider's ID, and every pair in productionPairs run with no author.
Negative: on the PR's first commit (d8533a36f, a whole-title check after ranking), 9 of its 26 cases fail, including 4 correct production pairs.
go test ./internal/audiobooks/ ./internal/ebooks/ ./internal/manga/ ./internal/metadata/ passes.
Not run: enrichment against live Audnexus or Apple Books results; a real library scan; the full make test-go.
Evidence
No visible layout change. The evidence is which candidates are admitted for an item with no author, from the new test on ad41076f5, with the failing run on d8533a36f.
A short title (under 12 characters) needs a candidate with the same words. A provider title that adds a subtitle, such as "Raw Stream: A Dark Fantasy" for a folder named "Raw Stream", leaves the book unmatched. An admin can match it by hand.
Word order is ignored, so "Worlds of War" still counts for "War of the Worlds". Ranking already scores that pair 1.0 on main.
Books already mismatched before this change keep their metadata until an admin rematches them.
Ebooks and manga keep the old rule. They have the same gap for items with no author.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code (Claude desktop app, Code tab)
Reject partial title matches for audiobooks with no author
When an audiobook item has a blank author, a search result is now admitted only if the title itself identifies the book, or the result shares an existing provider ID with the item. The audiobooks enricher sets the new NoAuthor flag on the admission request, and metadata.AdmitSearchMatch filters candidates through titleOnlyCandidates before selecting a match.
Title identification lives in metadata.titleAloneIdentifies in match_confidence.go: it accepts exact normalized titles, whole-title containment with word boundaries, and equivalent identity-word sets (stopwords and volume markers like "Book 2" excluded).
metadata.sharesProviderID keeps a candidate eligible when it has the same non-empty ID under the same provider, comparing provider names case-insensitively in match_admission.go.
Adds table-driven tests in match_admission_test.go covering partial matches, word boundaries, repeated words, aliases, and provider IDs.
Behavioral Change: with no author, selection may now pick a lower-scoring candidate that passes the title check, or return no match when none qualify — check AdmitSearchMatch and titleAloneIdentifies for the new thresholds.
…atch
Audiobook enrichment gave an untagged book another, real book's author,
cover, summary and runtime when the titles shared a word or two. A
one-word prefix of a two-word title scores 0.667, above the 0.5 bar
("Raw Stream" against "Raw"), and the author check after GetMetadata
passes when the item names no author, so nothing contradicted the match.
The item then stopped showing as unmatched.
SearchMatchAdmissionRequest gets NoAuthor, which the audiobook enricher
sets for an item without an author. Such an item, unless it carries a
provider ID, admits a candidate only when the candidate holds the whole
wanted title as a run of words: the same title, or a longer form of it
such as a series suffix. "Raw" for "Raw Stream" and "The Book of
Unknown Americans" for "Unknown Author Book" are no credible match, so
the book keeps its filename title for an admin to match by hand. Books
with an author, ebooks and manga are unchanged.
ClosesSilo-Server#3161
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 5f59f5e5-525f-42a2-845f-dca732e0fc8c
Commits
Reviewing files that changed from the base of the PR and between c64315c and ad41076.
Files selected for processing: 2
internal/metadata/match_admission_test.go
internal/metadata/match_confidence.go
No actionable comments were generated in the recent review.
Walkthrough
Audiobook enrichment marks requests with blank authors. Search-match admission then filters candidates by title identity or a matching existing provider ID before year-based selection.
Changes: Audiobook match admission
Layer / File(s)
Summary
No-author title admission internal/metadata/match_admission.go, internal/metadata/match_confidence.go, internal/audiobooks/enrichment.go, internal/metadata/match_admission_test.go
Audiobook enrichment sets NoAuthor when the trimmed author is empty. Admission filters candidates by title identity or a matching existing provider ID before year-based selection. Title comparisons handle blank result names, aliases, normalized word sets, and volume markers. Tests cover accepted and rejected matches.
Untagged audiobooks now need a title that identifies the book, or a matching provider ID the item already has, before provider metadata is applied. The earlier concerns about alias ties and IDs from other providers are addressed, and no actionable merge risk remains.
Security architecture risk: Minimal · up to c6431
The change adds an identity filter before existing match selection and ownership checks. The inspected change establishes no introduced or worsened risk to security, failure containment, rollback, or ownership guarantees.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the audiobook fix and its scope: an untagged book stays unmatched when a title match is only partial. It matches the main change in the changeset, which sets NoAuthor, filters admissio…
Linked Issues check
Issue #3161 requires three behaviors for an untagged audiobook with no author. (1) A candidate that matches only part of the folder title stays unmatched. (2) A full title match can still be accepted.…
Out of Scope Changes check
The changes since the previous review are limited to identityWords in match_confidence.go (stopword removal, and retention of all words when none remain) and one added test case, 'a dropped leading ar…
Description check
The description is specific and on-topic. It explains the bug (partial title matches assigning another book's metadata to untagged audiobooks), the cause (TitleScore prefix match and AuthorsAgree trea…
Full details: Title check
Explanation
The title names the audiobook fix and its scope: an untagged book stays unmatched when a title match is only partial. It matches the main change in the changeset, which sets NoAuthor, filters admission results by title identity, and adds titleAloneIdentifies. The title uses the conventional fix(scope) prefix and fits the change.
Full details: Linked Issues check
Explanation
Issue #3161 requires three behaviors for an untagged audiobook with no author. (1) A candidate that matches only part of the folder title stays unmatched. (2) A full title match can still be accepted. (3) A match on an ID the item already holds can still be accepted. The enricher sets NoAuthor when the item author is empty (internal/audiobooks/enrichment.go, per the summary). AdmitSearchMatch filters candidates through titleOnlyCandidates before ranking. titleAloneIdentifies in internal/metadata/match_confidence.go rejects 'Raw' for 'Raw Stream' (3 characters, below the 12-character floor). It rejects 'Dune' for 'Dune Messiah' by the same floor. It rejects 'The Book of Unknown Americans' for 'Unknown Author Book' because the word sets differ. Identical titles and shared-ID matches are kept. The incremental change since c37bb92 extends identityWords to drop stopwords, so 'The Hobbit' matches 'Hobbit' as a full title match. This does not weaken the partial-match rules checked above. minTitleScore and AuthorsAgree are unchanged. Stack review evidence is unavailable, so no stack objectives were assessed beyond the current PR. Limits: the incremental diff was read, but the titleStopwords declaration was not reread, and tests were not rerun in this assessment. Live provider behavior was not exercised.
Full details: Out of Scope Changes check
Explanation
The changes since the previous review are limited to identityWords in match_confidence.go (stopword removal, and retention of all words when none remain) and one added test case, 'a dropped leading article', in match_admission_test.go. Both sit on the title-identity path that titleAloneIdentifies uses, and that path runs only when NoAuthor is set. The stopword change supports the full-title-match requirement of #3161 for article variants such as 'The Hobbit' and 'Hobbit'. It does not change non-audiobook flows or items with an author. The rest of the PR (NoAuthor field, enricher flag, titleOnlyCandidates, provider-ID bypass) is unchanged from the prior reviewed state and remains tied to #3161. The PR description still describes an older approach and test name in places. That is a documentation mismatch, not an unrelated code change. Limit: titleStopwords was not reread in this assessment.
Full details: Description check
Explanation
The description is specific and on-topic. It explains the bug (partial title matches assigning another book's metadata to untagged audiobooks), the cause (TitleScore prefix match and AuthorsAgree treating a missing author as agreement), and the fix (NoAuthor flag, title-identification filter, provider-ID bypass). It also lists the files touched, the validation run, what was not run, and the risks. This is far more than the lenient check requires.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: ec093e30-fd4a-4d7d-b41e-a6ef1f120cac
Commits
Reviewing files that changed from the base of the PR and between c37bb92 and c64315c.
Files selected for processing: 2
internal/metadata/match_admission_test.go
internal/metadata/match_confidence.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Rejecting the best partial match hides valid later candidates
Provider ordering can leave a correctly identifiable audiobook unmatched when a partial match ties a full-title match. Apply titleCovers while selecting candidates.
Prompt for LLM
File internal/metadata/match_admission.go, lines 87-89:
Rejecting the best partial match hides valid later candidates
The coverage check rejects the highest-scoring result without considering other results that cover the complete title. For example, a partial containment result can tie a longer full-title result at the 0.9 containment score, so provider ordering can leave a correctly identifiable audiobook unmatched; apply the coverage predicate while selecting candidates.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming. Filtering candidates before ranking addresses the issue of a partial match hiding a valid full-title match. I haven’t independently verified commit c37bb923e.
The reason will be displayed to describe this comment to others. Learn more.
Series-prefixed scanner titles are rejected against canonical titles
Authorless audiobooks with series-prefixed scanner titles can remain unmatched despite a correct provider result. Check the existing scoring logic and allow titleCovers to recognize the canonical title within the scanner title.
Prompt for LLM
File internal/metadata/match_confidence.go, line 146:
Series-prefixed scanner titles are rejected against canonical titles
The one-way containment test rejects scanner titles that include a series prefix around the provider's actual title. The existing scoring logic explicitly supports `Series 2 - Title` versus `Title`, but authorless audiobooks in that format now remain unmatched despite their correct provider result.
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, and it reaches further than series prefixes. An untagged book takes its title from its folder name, which keeps author prefixes, series numbers and years. With no author, this head refused all of these, which main accepts:
"Andy Weir - Project Hail Mary" for "Project Hail Mary"
"Stormlight Archive 1 - The Way of Kings" for "The Way of Kings"
"Project Hail Mary 2021" for "Project Hail Mary"
"Pride & Prejudice" for "Pride and Prejudice"
4 of the 7 correct pairs in productionPairs, for example "Phoenix Brothers Series 2 - More Than a Phoenix" for "More than a Phoenix (Phoenix Brothers Book 2)"
Fixed in c37bb92. titleAloneIdentifies compares content words. A candidate counts when both titles have the same words, in any order, or when one title's words all appear in the other and the shorter title is at least 12 characters long. A volume word before a number ("Series 2", "Book 2") is left out of the comparison. The new test runs every productionPairs case with no author, and it failed on d8533a3 for the four pairs above.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. The original suggestion was valid, and the folder-title examples show the issue extends beyond series prefixes. The new productionPairs test provides useful regression coverage for those cases.
One tradeoff is worth checking: comparing words in any order and allowing a shorter title of at least 12 characters to be contained in a longer one could admit distinct books with overlapping titles. Tests for those cases would help confirm the change still protects against the original false matches. I haven’t independently verified the commit or run its tests.
The reason will be displayed to describe this comment to others. Learn more.
Title coverage rejects CJK titles with an unspaced provider suffix
A provider suffix can leave an otherwise valid unspaced CJK title unmatched, even though the existing title scorer accepts it. Update titleCovers to handle scripts without whitespace-delimited words.
Prompt for LLM
File internal/metadata/match_confidence.go, line 146:
Title coverage rejects CJK titles with an unspaced provider suffix
The space-delimited containment check rejects unspaced CJK titles when a provider appends a suffix, such as `進撃の巨人完全版` for `進撃の巨人`, even though the existing title scorer accepts this containment. Handle scripts without whitespace-delimited words when checking title coverage.
The reason will be displayed to describe this comment to others. Learn more.
Confirmed: "進撃の巨人" against "進撃の巨人完全版" is one token on each side, so the word-boundary check fails where main accepts the match. Fixed in c37bb92. Plain containment with the 12-byte floor is one of the accepted shapes, which covers unspaced scripts. "進撃の巨人特装版" is now accepted for "進撃の巨人".
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming. The reported CJK suffix case is addressed in c37bb923e: the title can now match a provider title with an unspaced suffix when it meets the 12-byte containment floor.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Prefer a covering alias when title scores tie. · match_confidence.go:379
internal/metadata/match_confidence.go:379 Minor · Functional Correctness · Quick win
Prefer a covering alias when title scores tie.
For wanted "War of the Worlds", a primary name of "Worlds of War" scores 1. An exact "War of the Worlds" alias also scores 1. This strict comparison retains the primary name, so the new coverage gate rejects the result despite its exact alias.
For requests that require coverage, let a covering alias replace a non-covering title on a score tie. Filtering other search results alone does not fix this single-result case.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: b1c8934e-2b0e-4e72-8572-95cc2848cec5
Commits
Reviewing files that changed from the base of the PR and between b644da1 and d8533a3.
Files selected for processing: 4
internal/audiobooks/enrichment.go
internal/metadata/match_admission.go
internal/metadata/match_admission_test.go
internal/metadata/match_confidence.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The whole-title check rejected correct matches whose folder title carries
an author or series prefix ("Andy Weir - Project Hail Mary") and four of
the six calibrated production pairs, still admitted a short title inside
a longer one ("Dune Messiah" for "Dune"), and was skipped for every
provider after the first once any ID was in the run's map.
For an item with no author, a candidate now counts when its title has the
same content words as the wanted title, or when one title's words all
appear in the other and the shorter is at least the existing containment
floor, or when it carries an ID the item already holds. Candidates are
filtered before selection, so a credible lower-scoring result still wins.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at d8533a3. Gating admission for an item with no author is the right fix at the right boundary. The enricher knows the author is missing, and AdmitSearchMatch is where a candidate is judged. The rule the gate applies needs to change, though. I'm fixing every finding below in a commit on this branch, so there's no need to change anything yourself.
Correct matches are refused. An untagged book takes its title from its folder name, which often carries an author prefix, a series prefix or a year. Details in the existing thread on match_confidence.go:146.
A short title still matches a longer, different book. See the inline comment.
The check is skipped for every provider after the first. Once a provider has admitted a match, any ID in the run's map exempts the next provider's candidate. Details in the existing thread on match_admission.go:87.
The check runs after ranking. A credible lower-scoring candidate, or an exact alias tied with a primary title that fails the check, is never tried. Details in the existing thread on match_admission.go:88.
Reviewed head: ad41076 (the PR's commit, two review fixes, and the author's follow-up, which matches whole words and counts repeated words).
Addressed
The gate for items with no author is in the right place, but its whole-title check got the rule wrong in both directions. Fixed in c37bb92 and c64315c:
Folder titles with an author or series prefix were refused: "Andy Weir - Project Hail Mary", "Stormlight Archive 1 - The Way of Kings", "Pride & Prejudice", and 4 of the 7 correct pairs in productionPairs. They match again.
A short title inside a longer one was still admitted: "Dune Messiah" for "Dune", "Raw Stream" for "Raw". It's refused now.
Every provider after the first skipped the check, because any ID in the run's map exempted it. So did an item whose only ID is the scanner's asin row. Now only a candidate carrying an ID the item already holds, under the same provider, skips the title check.
The check ran on the top-ranked candidate only. Results are now filtered before ranking, and aliases count.
A dropped leading article ("Hobbit" for "The Hobbit") was refused by the first fix. CodeRabbit caught it, and it's fixed in c64315c.
For an item with no author, a candidate now counts when its title has the same words as the wanted title, ignoring stopwords, or when one title's words all appear in the other and the shorter title is at least 12 characters. That is the floor the existing containment rule uses.
Remaining for the maintainers
Maintainer decision: how strict to be for short titles. A title under 12 characters now needs a candidate with the same words. So "Raw Stream: A Dark Fantasy" no longer matches a folder named "Raw Stream". The PR's first commit accepted that pair, but it also accepted "Dune Messiah" for "Dune". The cross-provider review argued for an even stricter rule (same title only), which would refuse every author- or series-prefixed folder.
Books mismatched before this change keep their metadata until an admin rematches them.
Validation
TestAdmitSearchMatchWithoutAnAuthorNeedsTheTitleToIdentifyTheBook (26 cases) fails on the PR's first commit, d8533a3, in 9 cases, and passes on ad41076. Its leading-article case also failed on c37bb92. It can't build on main, where NoAuthor doesn't exist. Run without NoAuthor, the same pairs are all admitted, which is the reported behavior.
go test ./internal/metadata/ ./internal/audiobooks/ ./internal/ebooks/ ./internal/manga/ passes, and the changed-lines lint is clean.
Not shown live: no enrichment run against real provider results.
Validated features: I couldn't read the validation board. From the public validation comments, no recorded passed case changes: tagged books never reach this path. The PR unblocks #1253 CORE2, #1254 C2 (#3162 still blocks it) and Silo-Server/silo-plugin-metadata-audiobook#12 C3, and the Validation tasks: line now says so. Those comments also name #3161 as the blocker for plugin#12 C4 and #1256 C2.
User manual: unaffected. The audiobook pages describe matching in terms of tags and ASINs, not title rules.
Other clients: N/A. The change is in server-side enrichment, and every client shows the stored metadata. jellycompat and the Audiobookshelf surface read the same catalog.
Verdict
Fit: 9/10 · Readiness: 8/10 — conditional
Fit: it fixes a wrong-metadata bug at the boundary that judges candidates, with no new setting or surface.
Readiness: the fix is tested against the production calibration pairs. Two things hold it below 9: the short-title decision above is open, and nothing has run against live provider results.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 271c9f74-fb10-4059-8a6c-b4b860807271
Commits
Reviewing files that changed from the base of the PR and between d8533a3 and c37bb92.
Files selected for processing: 3
internal/metadata/match_admission.go
internal/metadata/match_admission_test.go
internal/metadata/match_confidence.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
…itle words
"Hobbit" for "The Hobbit" was refused: contentWords keeps every word
when fewer than two content words remain, so the sets differed by "the".
identityWords now drops stopwords itself and leaves the shared scoring
fallback alone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…itle check
From Kody's review of c37bb92: titleAloneIdentifies tested containment
with strings.Contains, so "The Green Mile" covered "The Green Milestone"
(both over the 12-character floor). It also compared word sets, so
"New York, New York" and "New York" had the same words.
Containment of a spaced title now matches whole words only; a title
with no space, as an unspaced script normalises to, keeps plain
containment. identityWords counts each word, and wordSubset needs every
word at least as often. Word order still doesn't matter ("Hobbit, The").
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Ignoring interior stopwords admits distinct book titles
An authorless book can inherit another work's metadata because titles such as War and Peace and War or Peace also pass the Dice score. Limit titleStopwords removal to decorative articles and retain meaningful interior words.
Prompt for LLM
File internal/metadata/match_confidence.go, lines 184-185:
Ignoring interior stopwords admits distinct book titles
Removing conjunctions equates distinct titles such as `War and Peace` and `War or Peace`, allowing an authorless book to inherit the other work's metadata because both candidates also pass the Dice score. Limit article removal to positions where it represents a title decoration, and retain meaningful interior words.
The reason will be displayed to describe this comment to others. Learn more.
The pair does pass, but this check didn't introduce it. The shared scorer already treats the two titles as the same: on main, TitleScore("War and Peace", "War or Peace") is 1.00 and BestMatch admits it, for books with an author too, because contentWords drops "and" and "or". The authorless check removes the same words.
Keeping interior stopwords would split pairs that are the same work, for example "Pride & Prejudice" and "Pride and Prejudice", because normalisation drops the "&". Titles that differ only by a conjunction are rare by comparison. So I'm leaving it as is. If it turns out to matter, the change belongs in the shared stopword handling, so that books with an author get it too.
The reason will be displayed to describe this comment to others. Learn more.
That’s a reasonable decision. The example exposes an existing limitation in the shared scorer, rather than a regression introduced by this PR. I’ll withdraw the suggestion as a blocker.
One nuance: fixing shared scoring could protect other media types too, but it isn’t the only possible place to address the authorless case. If this becomes a practical problem, preserving meaningful conjunctions while normalizing & to and could be worth evaluating against the calibration pairs.
… title match (#4221)
* fix(ebooks, manga): keep a book with no author unmatched on a partial title match
Ebook and manga enrichment called AdmitSearchMatch without NoAuthor, so
an item with no author admitted a candidate on a title score above 0.5
("Raw" for "Raw Stream"), and AuthorsAgree let the match through after
GetMetadata. #4151 closed this for audiobooks only.
Both enrichers now set NoAuthor from the item's author, as the
audiobook enricher does. Such an item is matched only when the title
identifies the book on its own or the candidate carries an ID the item
already holds. Items with an author are unchanged.
Closes#4154
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(ebooks): match a no-author ebook against the title it was searched with
From Kody's review: an ebook titled "Dune (2019)" is searched as "Dune",
since the search drops a bare year or series marker, but the no-author
check compared candidates with the raw title. "Dune" is shorter than the
12-character containment floor, so the book could never match.
SearchMatchAdmissionRequest gets NoAuthorTitle, the title the no-author
check compares with when it differs from WantTitle. The ebook enricher
sets it to the searched title. WantTitle still scores candidates and
checks their volume, so a different volume is still rejected.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* fix(manga): match a no-author series without its release tag
A manga series item has no author until its first match, so every new
series takes the no-author title check. The scanner strips trailing
(...) groups from folder names but keeps [...] ones, so "Naruto
[Digital]" refused "Naruto" and the series was stamped as no-match for
good. Compare the title without trailing release tags; WantTitle still
scores candidates and checks volumes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Quick104 <[email protected]>
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
bugSomething isn't workinggoPull requests that update go codeimpact: usabilityCore flow broken or severely blockedpriority: P2Limited scope, workaround exists, or polishsize/M50–199 added + deleted lines (all files); change volume, not priority.
2 participants
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.
Problem
Closes #3161
Validation tasks: unblocks #1253 CORE2, #1254 C2 (#3162 still blocks it), Silo-Server/silo-plugin-metadata-audiobook#12 C3
Other clients: Apple, Android and Roku N/A. The change is in server-side enrichment; clients show whatever metadata the server stores.
Audiobook enrichment gave an untagged book another, real book's author, narrators, cover, summary and runtime when the titles shared a word or two.
TitleScorescores a one-word prefix of a two-word title at 0.667, above the 0.5 bar ("Raw Stream" against "Raw").AuthorsAgreetreats a missing item author as agreement, so nothing contradicted the match. The item then stopped showing as unmatched.This PR has no dependencies and can merge in any order.
Approach
SearchMatchAdmissionRequestgetsNoAuthor. The audiobook enricher sets it when the item's author is empty (internal/audiobooks/enrichment.go).NoAuthorset,AdmitSearchMatchfilters the provider's results before ranking them (titleOnlyCandidatesininternal/metadata/match_admission.go). A result stays when one of its titles (primary, original, or an alias) identifies the book on its own, or when it carries an ID the item already holds under the same provider.titleAloneIdentifiesininternal/metadata/match_confidence.go) when both titles have the same words in any order, ignoring stopwords such as "the" and "and", or when one title's words all appear in the other and the shorter title is at least 12 characters. That is the floor the existing containment rule uses. A volume word before a number ("Series 2", "Book 2") is ignored, because ranking already rejects a volume that disagrees.minTitleScoreandAuthorsAgreeare unchanged, as the issue asked. Books with an author, ebooks, manga, movies and series admit matches as before.Validation
gofmt,go vetand the changed-lines lint are clean.TestAdmitSearchMatchWithoutAnAuthorNeedsTheTitleToIdentifyTheBookcovers the issue's pairs in both directions, an author-prefixed folder, an ampersand, a dropped leading article ("Hobbit" for "The Hobbit"), a candidate carrying the item's own ID, one beside another provider's ID, and every pair inproductionPairsrun with no author.d8533a36f, a whole-title check after ranking), 9 of its 26 cases fail, including 4 correct production pairs.go test ./internal/audiobooks/ ./internal/ebooks/ ./internal/manga/ ./internal/metadata/passes.make test-go.Evidence
No visible layout change. The evidence is which candidates are admitted for an item with no author, from the new test on
ad41076f5, with the failing run ond8533a36f.Evidence: https://evidence.siloserver.org/r/silo-server/pr-4151/
Risks
main.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Reject partial title matches for audiobooks with no author
When an audiobook item has a blank author, a search result is now admitted only if the title itself identifies the book, or the result shares an existing provider ID with the item. The audiobooks enricher sets the new
NoAuthorflag on the admission request, andmetadata.AdmitSearchMatchfilters candidates throughtitleOnlyCandidatesbefore selecting a match.metadata.titleAloneIdentifiesin match_confidence.go: it accepts exact normalized titles, whole-title containment with word boundaries, and equivalent identity-word sets (stopwords and volume markers like "Book 2" excluded).metadata.sharesProviderIDkeeps a candidate eligible when it has the same non-empty ID under the same provider, comparing provider names case-insensitively in match_admission.go.AdmitSearchMatchandtitleAloneIdentifiesfor the new thresholds.Macroscope summarized ad41076.