[BUG] Ebook matched to a bundle via `subjects`/`genres` tags, ignoring an exact `title` tag

Aperta
#376 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, docker, github
Ambito
backend, database

Direzione di ricerca

Start by tracing the matching flow that records book_proved_by evidence from embedded EPUB fields, then inspect the manual import and download association path described in the report. Reproduce with the supplied title, subjects, and genres values and compare the selected book with the grabbed book. Done when exact title evidence takes precedence and a mismatched book cannot be imported without explicit confirmation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
An EPUB whose embedded title tag is exactly the requested book ("Threshing Day")
was matched to a different book by the same author: the 2-book collection
"Fourth Wing, Iron Flame" (The Empyrean #1-2). The matcher used the
subjects/genres keyword list as proof of the book, because the publisher's
keyword list happens to contain the bundle's exact title as a substring:

subjects: Red Tower, Entangled, Rebecca Yarros, Romantasy, Fourth Wing, Iron Flame, Onyx Storm, Not Book Four, Threshing, Dragons, short stories, novella, POVs, lore, theories, fantasy, multi-pov

The import was then filed under "Fourth Wing, Iron Flame" (unmonitored, BookId 335)
instead of "Threshing Day" (monitored, BookId 311). The tracked download stayed
importBlocked, which later caused a "path does not exist" error and a second
download/import of the same book.

To Reproduce

  1. Add author Rebecca Yarros with metadata that includes the collection
    "Fourth Wing, Iron Flame" (The Empyrean #1-2, hc work 2389432) in the catalog.
  2. Monitor and search "Threshing Day" (The Empyrean #3.5, hc work 2769384).
  3. Let a completed download import an EPUB with these embedded tags:
    • title: Threshing Day
    • author / creator: Rebecca Yarros
    • identifier: 978-1-68281-852-7
    • publisher: Entangled Publishing, LLC
    • subjects / genres: as above (contains Fourth Wing, Iron Flame)
  4. The file is matched to "Fourth Wing, Iron Flame".

Matching log (/config/logs/matching/matching-2026-11-16.json, trimmed)

"result": {
  "reason": "Matched via Holy Grail FTS + smoke test (author-restricted)",
  "book": "Fourth Wing, Iron Flame (ID:335)",
  "edition": "Fourth Wing, Iron Flame (ID:1124)",
  "matched_via": "staged_field_representation",
  "outcome": "MATCHED",
  "book_proved_by": [
    {"source":"embedded_tag","field":"subjects","value":"Red Tower, Entangled, Rebecca Yarros, Romantasy, Fourth Wing, Iron Flame, Onyx Storm, ..."},
    {"source":"embedded_tag","field":"genres","value":"Red Tower, Entangled, Rebecca Yarros, Romantasy, Fourth Wing, Iron Flame, Onyx Storm, ..."}
  ]
}

Queue status for the tracked download (/api/v1/queue)

trackedDownloadState : importBlocked
errorMessage         : Import completion could not be proven for the requested files and books
statusMessage        : Rejected: Completed download was grabbed for 'Threshing Day' (BookId 311, work hc:2769384),
                       but import matched 'Fourth Wing, Iron Flame' (BookId 335, work hc:2389432).

Chaptarr log

[Info] ManualImportService: [MANUAL-IMPORT][DOWNLOAD-ASSOCIATION] Associated 1 selected files with download '<id>'
[Info] ImportApprovedBooks: [NOTIFY] Published BookImportedEvent for 'Fourth Wing, Iron Flame' (BookId=335, Files=1, OldFiles=0, NewDownload=True)
...
[Error] DownloadedBooksImportService: Import failed, path does not exist or is not accessible by Chaptarr: /downloads/<download folder>/

The grab-vs-match guard correctly blocked the automatic import, but the file was
still imported to the wrong book through the manual-import / download-association
path ~2 minutes after the download completed, without anyone choosing that book.

Expected behavior

  • An exact match on the embedded title tag should outweigh a substring hit in
    free-text keyword fields (subjects, genres, description).
  • subjects/genres should probably not count as book_proved_by evidence on
    their own, or only when no title evidence is present.
  • When the matched book differs from the grabbed book, the file should not be
    imported to the other book by any path without explicit user confirmation.

Related (different trigger, same symptom)

  • #111 / #155: the same "grabbed for X but import matched Y" rejection, caused by
    duplicate rows for the same work (hc vs gr). Here the two books are genuinely
    different works (#3.5 vs a #1-2 collection), so the #155 retarget for
    equivalent rows would not apply.
  • #262: import matches a sibling book, triggered by a subtitle in dc:title.
    Here dc:title is exact and the wrong evidence comes from subjects/genres.

Workaround
Manual Import from Activity → Queue with the book set to "Threshing Day", then
deleting the collection "Fourth Wing, Iron Flame" from the author.

System Information:

  • OS: Linux (Docker host)
  • Chaptarr Version: 0.9.1000 (chaptarr/chaptarr:0.9.1000)
  • Installation Method: Docker (Compose)
  • Browser: Chrome
  • Match mode: Balanced
  • Metadata: Goodreads + Hardcover connected

Additional context
Download client: SABnzbd. Root folder is ebook-only. Metadata profile has
"Skip part books and sets" enabled; the collection title "Fourth Wing, Iron Flame"
doesn't look like a set, so it wasn't filtered.

Lingua principale
C#
Stelle
664
Fork
48
Merge medio
5h 24m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Chaptarr/chaptarr

Tutte le issue di Chaptarr/chaptarr

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.