fix(search): result filters never ran on auto-pick paths; add title-relevance gate#744
Draft
kevinheneveld wants to merge 1 commit into
Draft
Conversation
…itle-relevance gate The SearchResultFilterPipeline (including AudiobookOnlyFilter) only ran inside AsinEnricher's metadata-enrichment path — the automatic sweep and SearchAndDownloadAsync applied NO result filters at all, so raw indexer results went straight to quality scoring, where a well-seeded music bootleg outranks a real audiobook. - Apply the pipeline in both auto-pick call sites, with a new context-aware ISearchResultFilter overload (default-implemented, so existing filters need no edits) and pipeline audiobook parameter. - New RelevanceFilter: requires >=30% title+author token overlap against the wanted audiobook (the "Patterson Hood concert vs James Patterson novel" defense), with author corroboration for generic single-word titles. Fails open without audiobook context. - Restrict automatic searches to Newznab category 3030 (Books > Audiobook) so music-only indexers can't answer audiobook queries. - SearchAndDownloadAsync moved to a DownloadService.SearchAndDownload.cs partial (architecture size cap). - Includes TitleMatcher (punctuation-tolerant Normalize with numeral canonicalization + Matches) and SignificantTokens; note PR Listenarrs#722 also introduces TitleMatcher.cs with identical content - trivial merge whichever lands first. Co-Authored-By: Claude Fable 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.
The bug
The
ISearchResultFilterpipeline (includingAudiobookOnlyFilter) only runs insideAsinEnricher's metadata-enrichment path — the automatic sweep and search-and-download apply no result filters at all. Raw indexer results go straight to quality scoring, where a well-seeded music bootleg with a similar name outranks the real audiobook. Field impact (live library): frequent music grabs in place of similarly-named books.The fix
AutomaticSearchProcessor,DownloadService.SearchAndDownloadAsync), with a context-awareApplyFilters(..., audiobook)overload (default-implemented — existing filters unchanged)RelevanceFilter: ≥30% title+author token overlap against the wanted book (the "Patterson Hood vs James Patterson" defense), with author corroboration required for generic single-word titles3030restriction on automatic searches (junk filtered at the indexer where honored; RelevanceFilter catches the rest)TitleMatcher(Normalize incl. numeral canonicalization —1st≡first— +Matches) andSignificantTokens. Note: PR feat(library): "Split collection" — break a multi-book record into its real books #722 introduces the sameTitleMatcher.cswith identical content — whichever merges second is a trivial resolution.Tests
17-case relevance suite (overlap thresholds, corroboration, numeral equivalence, music-title rejection); full suite passing.
🤖 Generated with Claude Code