Skip to content

fix(ebooks, manga): keep a book with no author unmatched on a partial title match - #4221

Merged
Quick104 merged 3 commits into
Silo-Server:mainfrom
rangoDJ:fix/ebook-manga-no-author-match-4154
Nov 15, 2026
Merged

Quick104 merged 3 commits into
Silo-Server:mainfrom
rangoDJ:fix/ebook-manga-no-author-match-4154

Conversation

@rangoDJ

@rangoDJ rangoDJ commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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.AdmitSearchMatch without NoAuthor. An item with no author then admitted a candidate on a title score above 0.5 ("Raw" scores 0.67 against "Raw Stream"), and AuthorsAgree let the match through after GetMetadata, 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.go and internal/manga/enrichment.go set NoAuthor: strings.TrimSpace(item.Author) == "", as internal/audiobooks/enrichment.go does.
  • Such an item is matched only when the candidate's title identifies the book on its own, or the candidate carries an ID the item already holds (the rule fix(audiobooks): keep an untagged book unmatched on a partial title match #4151 added to AdmitSearchMatch). Items with an author are unchanged.
  • Ebooks read an author from the path when tags lack one, so fewer ebooks reach this state than audiobooks.
  • The no-author check compares the title without file-name decorations, set as NoAuthorTitle on SearchMatchAdmissionRequest. Ebooks pass the searched title (cleanEbookSearchTitle drops a year, series marker, or edition text, so Dune (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]). WantTitle still scores candidates and checks volumes, so this filter can only refuse a candidate main would accept.
  • Manga series items have no author until their first match, so every new manga series takes this path.

Validation

  • gofmt, go vet and the changed-lines lint are clean.
  • New TestEbookWithoutAnAuthorNeedsTheWholeTitle and TestMangaWithoutAnAuthorNeedsTheWholeTitle call collectEbookMetadata / collectMangaMetadata with one provider and check the provider IDs admitted, which are what GetMetadata fetches by:
    • "Raw" for "Raw Stream" with no author: refused;
    • "Raw Stream" for "Raw Stream" with no author: admitted;
    • "Raw" for "Raw Stream" with an author: admitted, as before.
  • Negative: with the two enricher lines removed, the refused case fails in both packages.
  • TestEbookWithoutAnAuthorMatchesTheSearchedTitle: "Dune" for "Dune (2019)" is admitted and "Dune Messiah" refused; the admitted case fails without NoAuthorTitle.
  • TestMangaWithoutAnAuthorNeedsTheWholeTitle rows: "Naruto" for "Naruto [Digital]" is admitted and "Naruto Gaiden" refused; the admitted row fails without the manga NoAuthorTitle.
  • go test ./internal/ebooks/ ./internal/manga/ ./internal/metadata/ ./internal/audiobooks/ passes.
  • Not run: enrichment against live providers; the full 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), main at 3e84ec196, this PR at 1617e0349.

Item (title, author) Candidate main This PR
Raw Stream, none Raw admitted refused
Raw Stream, none Raw Stream admitted admitted
Raw Stream, Someone Raw admitted admitted (unchanged)
$ go test -count=1 -run WithoutAnAuthorNeedsTheWholeTitle ./internal/ebooks/ ./internal/manga/   # enricher lines removed
        enrichment_test.go:928: "Raw" for "Raw Stream" (author ""): matched = true, want false
FAIL	github.com/Silo-Server/silo-server/internal/ebooks
        enrichment_test.go:264: "Raw" for "Raw Stream" (author ""): matched = true, want false
FAIL	github.com/Silo-Server/silo-server/internal/manga

$ go test -count=1 -v -run WithoutAnAuthorNeedsTheWholeTitle ./internal/ebooks/ ./internal/manga/
--- PASS: TestEbookWithoutAnAuthorNeedsTheWholeTitle (0.00s)
ok  	github.com/Silo-Server/silo-server/internal/ebooks	0.109s
--- PASS: TestMangaWithoutAnAuthorNeedsTheWholeTitle (0.00s)
ok  	github.com/Silo-Server/silo-server/internal/manga	0.109s

Risks

  • An untagged ebook, or any new manga series, whose title is a short part of the provider's title (under 12 characters, or the reverse) now stays unmatched unless a provider alias matches, as audiobooks do since fix(audiobooks): keep an untagged book unmatched on a partial title match #4151. For example, a "Kaguya-sama" folder no longer matches "Kaguya-sama: Love Is War". An admin can match it by hand.
  • Items mismatched before this change keep their metadata until rematched.

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)
  • Tool(s): Claude Code; GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

🤖 Generated with Claude Code

Note

Fix no-author ebooks and manga to require a full title match

  • Books with no author no longer match candidates on a partial title. A one-word title prefix is now rejected; the full title is required.
  • ebooks.collectEbookMetadata sets a no-author flag when the item's author is blank, and passes the searched title for the title-only check in AdmitSearchMatch (enrichment.go).
  • manga.collectMangaMetadata sets the same flag but uses the item's own title for the check (enrichment.go).
  • metadata.SearchMatchAdmissionRequest gains 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).
  • Behavioral Change: no-author items with only a partial title match now stay unmatched; items with an author are unaffected.

Macroscope summarized 029d3c3.

… 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-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 14, 2026
@silo-kody

silo-kody Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Ebook and manga enrichment now indicate when an item's author is blank and provide a title for no-author matching. Search-match admission uses that title for candidate filtering, with a fallback to the requested title. Tests cover prefix, exact-title, and release-tagged title matches.

Changes: No-author metadata matching

Layer / File(s) Summary
No-author admission filter
internal/metadata/match_admission.go
SearchMatchAdmissionRequest adds NoAuthorTitle. When NoAuthor is true, candidate filtering uses the trimmed NoAuthorTitle, or WantTitle when it is blank. Scoring and volume checks continue to use WantTitle.
Enrichment title inputs and matching tests
internal/ebooks/enrichment.go, internal/ebooks/enrichment_test.go, internal/manga/enrichment.go, internal/manga/enrichment_test.go
Both enrichers pass whether the item's author is blank. Ebook matching uses the cleaned search title. Manga matching removes trailing parenthesized or bracketed tags, repeating the removal unless it would leave only whitespace. Tests cover prefix and exact-title matching, with and without an author, and matching against release-tagged titles.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: quick104

Merge Risk: Low · up to 75864

Authorless manga whose folder names end in a bracketed group that is not a release tag, such as "Raw [Stream]", can be matched to a different work, or can fail to match its exact title. Ebooks and manga with an author are unaffected. Restricting the cleanup to recognised release tags is a small fix and should be done before merging.

Pre-merge checks: Passed 2

Check name Status Explanation
Title check Passed The title names the main change: ebook and manga enrichment now keep a no-author item unmatched when only a partial title matches. It also names both affected areas (ebooks and manga). The changeset m…
Description check Passed The description is closely related to the changeset. It explains the problem (ebook and manga enrichment omitted NoAuthor, so partial title matches were admitted for items without an author), the appr…
Full details: Title check

Explanation

The title names the main change: ebook and manga enrichment now keep a no-author item unmatched when only a partial title matches. It also names both affected areas (ebooks and manga). The changeset matches this: the enricher sets NoAuthor when the author is blank, and the admission request gains NoAuthorTitle.

Full details: Description check

Explanation

The description is closely related to the changeset. It explains the problem (ebook and manga enrichment omitted NoAuthor, so partial title matches were admitted for items without an author), the approach (NoAuthor set from blank author, NoAuthorTitle for cleaned ebook and manga titles), the tests added, and the risks. It matches the summarized file changes in internal/ebooks, internal/manga, and internal/metadata.

  • 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: daa4c92e-7670-4284-a3dc-da1807ee5bda
Commits

Reviewing files that changed from the base of the PR and between 6eaeda2 and 1617e03.

Files selected for processing: 4

  • internal/ebooks/enrichment.go
  • internal/ebooks/enrichment_test.go
  • internal/manga/enrichment.go
  • internal/manga/enrichment_test.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.

@silo-triage silo-triage Bot added bug Something isn't working needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish labels Nov 14, 2026
Comment thread internal/ebooks/enrichment.go Resolved
…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

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

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.

​

​

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Comment thread internal/manga/enrichment.go Resolved
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

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

Comment on lines +1065 to +1067
func mangaIdentityTitle(title string) string {
for {
stripped := mangaTrailingTagRE.ReplaceAllString(title, "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

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.

​

​

@Quick104

Copy link
Copy Markdown
Contributor

🤖 Claude Code (claude-opus-5-5)

Review summary

Reviewed head: 75864e0 (the author's 029d3c3 plus one fix commit from this review).

Addressed

  • A no-author ebook with a decorated file name (Dune (2019), White Fang (AmazonClassics Edition), Red Queen (Book 1)) was refused although main matched it. The author fixed this in 029d3c3 by checking the searched title (NoAuthorTitle). I confirmed it covers the edition and series-marker cases as well as the year.
  • A manga series whose folder name ends in a square-bracket release tag (Naruto [Digital]) was refused, and the no-match stamp meant it was never retried automatically. Fixed in 75864e0: manga passes the title without trailing tags as NoAuthorTitle.
  • Kody's later point that an unnumbered "Dune" would now match Dune (Book 2) doesn't hold: that pair is refused on main and here. The reply in that thread has the measurements.

Left for maintainers

  • Manga series items have no author until their first match, so this rule now applies to every new manga series, not only untagged files. Exact titles and aliases still match. A short folder title inside a longer provider title doesn't, for example "Kaguya-sama" for "Kaguya-sama: Love Is War", though main accepted it. In exchange, "Dune" no longer takes "Dune Messiah". This is the trade fix(audiobooks): keep an untagged book unmatched on a partial title match #4151 made for audiobooks.

Validation

  • The PR's tests fail on the base (3e84ec196) for the stated reason and pass on the head. The new NoAuthorTitle rows each fail on the head before the commit that added them.
  • go test passes for internal/metadata, internal/ebooks, internal/manga and internal/audiobooks. Lint on the changed lines is clean.
  • Not run: enrichment against live providers.
  • Cross-provider review: one adversarial round (Codex, gpt-6.1-sol) on 1617e03. It raised the ebook-decoration and manga release-tag cases above. Both are resolved.

Validated features: none reached. Ebooks and manga have no validation tasks. Audiobook matching is unchanged: NoAuthorTitle is empty there, so it falls back to WantTitle.
User manual: unaffected. The ebooks page doesn't describe matching rules.
Other clients: N/A. The change is in server-side enrichment.

Fit: 8/10 · Readiness: 8/10 — conditional (assuming CI is green)

  • Fit: this closes a real mismatch in the beta book libraries using the rule audiobooks already have, with one optional field on an internal request. It's held at 8 by the manga trade-off above, which applies to every new manga series.
  • Readiness: tests that fail on the base prove the behavior. It's held at 8 by the open manga decision and the lack of a run against live providers.

@Quick104
Quick104 merged commit 31c9c4e into Silo-Server:main Nov 15, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Ebooks and manga with no author get another book's metadata from a partial title match

2 participants