Repository navigation
fix(ebooks, manga): keep a book with no author unmatched on a partial title match - #4221
Conversation
… 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. Silo-Server#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 Silo-Server#4154
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…d 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]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| NoAuthor: strings.TrimSpace(item.Author) == "", | ||
| // "Dune (2019)" is searched as "Dune", so a no-author item is | ||
| // matched against that title; the raw one still checks volumes. | ||
| NoAuthorTitle: searchQuery.Title, |
There was a problem hiding this comment.
Stripping volume markers admits unnumbered results for numbered books
Revises an earlier Kody suggestion on internal/ebooks/enrichment.go:886 (2026-11-14 23:47 UTC).
An unnumbered Dune result can be accepted for Dune (Book 2), causing metadata for the wrong book to be persisted. Preserve volume evidence when admitting candidates after stripping a series marker.
Prompt for LLM
File internal/ebooks/enrichment.go, line 889:
**Revises an earlier Kody suggestion** on `internal/ebooks/enrichment.go:886` (2026-11-14 23:47 UTC).
Stripping volume markers admits unnumbered results for numbered books
For a no-author ebook titled `Dune (Book 2)`, the cleaned identity `Dune` admits an unnumbered `Dune` result, and the raw-title volume check cannot reject it because the candidate has no volume marker, causing metadata for the wrong book to be persisted. Preserve volume evidence when admitting candidates after stripping a series marker; this revises the earlier suggestion because applying the cleaned title also admits volume-less results that the original title-only check rejected.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
🤖 Claude Code (claude-opus-5-5)
This doesn't happen. NoAuthorTitle only decides which results survive the no-author filter. Selection still scores each survivor against the raw WantTitle, including the volume, so the no-author path can only refuse candidates that main would accept, never admit new ones. Measured with AdmitSearchMatch on 029d3c3:
| Item title | Candidate | main | this PR |
|---|---|---|---|
| Dune (Book 2) | Dune | no_credible_match | no_credible_match |
| Red Queen (Book 2) | Red Queen | accepted | accepted |
An unnumbered result for a numbered book that scores high enough is accepted on main for items with or without an author. This PR doesn't change that.
There was a problem hiding this comment.
You’re right about the reported example. I withdraw the suggestion that this PR causes Dune (Book 2) to accept an unnumbered Dune result: the no-author filter runs first, but selection still uses the raw WantTitle (internal/metadata/match_admission.go:89–98). The measurements you provided show that result is rejected both before and after the PR.
The Red Queen example points to a pre-existing limitation, not a regression introduced by this change.
One qualification: filtering candidates before selection can change which candidate is selected when a provider returns multiple results. So I would not generalize the single-candidate results into a guarantee that the PR can never lead to a newly selected candidate. That caveat doesn’t establish a bug here, though.
Quick104
left a comment
There was a problem hiding this comment.
🤖 Claude Code (claude-opus-5-5)
One finding on the current head (029d3c3). The ebook half of the earlier year finding is covered by NoAuthorTitle, and I checked the edition and series-marker cases against it too (White Fang (AmazonClassics Edition), Red Queen (Book 1)): they match again because the searched title drops that text.
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]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| func mangaIdentityTitle(title string) string { | ||
| for { | ||
| stripped := mangaTrailingTagRE.ReplaceAllString(title, "") |
There was a problem hiding this comment.
Removing every trailing group conflates distinct manga series
A no-author series such as The Breaker (New Waves) can receive metadata for the original series instead of its sequel. Change mangaTrailingTagRE to strip only recognized release tags, preserving text that distinguishes the work.
Prompt for LLM
File internal/manga/enrichment.go, lines 1065-1067:
Removing every trailing group conflates distinct manga series
A no-author series such as `The Breaker (New Waves)` is reduced to `The Breaker`, allowing metadata for the original series to be admitted instead of its sequel. Strip only recognized release tags, preserving parenthesized or bracketed text that can distinguish the work.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed head: 75864e0 (the author's 029d3c3 plus one fix commit from this review). Addressed
Left for maintainers
Validation
Validated features: none reached. Ebooks and manga have no validation tasks. Audiobook matching is unchanged: Fit: 8/10 · Readiness: 8/10 — conditional (assuming CI is green)
|
Problem
Closes #4154
Related issue: #3161 (the audiobook half, fixed by #4151)
Validation tasks: none
Other clients: Apple, Android and Roku N/A. The change is in server-side enrichment; every client shows the stored metadata.
Ebook and manga enrichment called
metadata.AdmitSearchMatchwithoutNoAuthor. An item with no author then admitted a candidate on a title score above 0.5 ("Raw" scores 0.67 against "Raw Stream"), andAuthorsAgreelet the match through afterGetMetadata, since an empty author agrees with any credits. #4151 closed this for audiobooks only.This PR has no dependencies and can merge in any order. #4151, which it follows, is merged. #4214 mentions #4154 but states it doesn't fix it, and touches neither file this PR changes.
Approach
internal/ebooks/enrichment.goandinternal/manga/enrichment.gosetNoAuthor: strings.TrimSpace(item.Author) == "", asinternal/audiobooks/enrichment.godoes.AdmitSearchMatch). Items with an author are unchanged.NoAuthorTitleonSearchMatchAdmissionRequest. Ebooks pass the searched title (cleanEbookSearchTitledrops a year, series marker, or edition text, soDune (2019)still matches "Dune"). Manga passes the series title without trailing[...]/(...)release tags, since the scanner keeps square-bracket tags in folder names (Naruto [Digital]).WantTitlestill scores candidates and checks volumes, so this filter can only refuse a candidate main would accept.Validation
gofmt,go vetand the changed-lines lint are clean.TestEbookWithoutAnAuthorNeedsTheWholeTitleandTestMangaWithoutAnAuthorNeedsTheWholeTitlecallcollectEbookMetadata/collectMangaMetadatawith one provider and check the provider IDs admitted, which are whatGetMetadatafetches by:TestEbookWithoutAnAuthorMatchesTheSearchedTitle: "Dune" for "Dune (2019)" is admitted and "Dune Messiah" refused; the admitted case fails withoutNoAuthorTitle.TestMangaWithoutAnAuthorNeedsTheWholeTitlerows: "Naruto" for "Naruto [Digital]" is admitted and "Naruto Gaiden" refused; the admitted row fails without the mangaNoAuthorTitle.go test ./internal/ebooks/ ./internal/manga/ ./internal/metadata/ ./internal/audiobooks/passes.make test-go.Evidence
No visible layout change. The evidence is which candidate is admitted, from the new tests on WSL2 (Ubuntu,
go1.26.4 linux/amd64),mainat3e84ec196, this PR at1617e0349.mainRisks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Fix no-author ebooks and manga to require a full title match
ebooks.collectEbookMetadatasets a no-author flag when the item's author is blank, and passes the searched title for the title-only check inAdmitSearchMatch(enrichment.go).manga.collectMangaMetadatasets the same flag but uses the item's own title for the check (enrichment.go).metadata.SearchMatchAdmissionRequestgains an optional comparison-title field, used when the search title differs from the requested one (e.g. a year marker was stripped). It defaults to the requested title when blank (match_admission.go).Macroscope summarized 029d3c3.