Repository navigation
Retry automatic search with title only when title and author returns nothing - #825
matheusfillipe wants to merge 3 commits into
Conversation
|
I wanted to see what this retry sends to an indexer, so I ran it in throwaway containers: stock canary
With the indexer's Categories blank, no request carried The risk I see is Readarr sends a bare title as its last tier too (NewznabRequestGenerator.cs#L85-L90). Two things in the request path keep that safe: it builds no request for an indexer without categories (#L129-L131), and it won't save one (NewznabSettings.cs#L35-L37). Our fork has a version of the categories requirement, not yet exercised on a real install. #714's title-only fallback is opt-out ( How would you like this sequenced against #591 and #744? Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting. |
|
@m4bard thanks for testing it like that, the table made it really clear. I pushed a small change: the retries now go out with cat=3030, so a bare title like Ghosts only hits the audiobook category and can't pull in music or video. I tried it against my own indexers and Red Rising (Part 1 of 2) went from no results to picking the unabridged Red Rising. The sequels like Golden Son still show up in that list though, so a relevance check like the one in #744 would still help. I don't mind the order, happy to rebase on whichever lands first. |
Listenarrs#825 is based on 1.3.0. On 1.3.10 it pushes DownloadService.cs past the 500-line limit and its test class misses BaseTests and the Name/Category traits. Move the retry loop into SearchQueryFallbacks.SearchAsync, used by both search paths, and cover it with the Marche ou crève case (author credited as "Stephen King (alias Richard Bachman)"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I've been running this PR in my build on top of current canary, and it fixes a real case for me: Audible credits Marche ou crève to Merged as is onto
This is how I fixed them locally, on
Feel free to take any of it. |
854a58c to
332ac3e
Compare
|
Thanks @Yoldark34, your fixes looked right to me. I rebased onto 1.3.11 and took the shared helper and the test conventions. One thing I did differently is the empty query: the helper always runs the primary search and only filters the title retries, so it needs no special case. |
|
Thanks @matheusfillipe, filtering only the title retries is cleaner than my special case. I tested your update (332ac3e) on 1.3.11:
I haven't done a full code review, but it fixes the problems I had. |
|
Thanks for testing it @Yoldark34. |
|
@matheusfillipe Thank you for your contribution! This addresses a real discovery problem, but expanding title retries feels like a band-aid over the underlying selection issue: Listenarr currently ranks releases by quality without first establishing that they match the requested audiobook. I am very much aware of this behavior as it predates this PR. It's been on the back burner for a while because there are manual workarounds. To fix this properly it's going to require a lot more scope. I think we should structure the flow like this:
I propose recording the following candidate-matching contract in an ADR:
[Side note: The quality scoring algorithm needs more tuning as well...] Apply this contract to every query tier, including the original query. Continue to the next tier when no candidates pass both identity and quality requirements. |
|
Thanks @therobbiedavis I am currently happy with this workaround for my personal instance. I understand your vision but I think it is far fetched for me and obviously for this PR alone. Feel free to close if this band-aid is not wished. |
Revert of af27f9d, 275ebef and 50d1d5b (Listenarrs#825, author's version of 2026-10-14). The maintainer considers the title-only retry a band-aid over release selection, and its author won't take it further: the PR will most likely be closed. Automatic and interactive searches go back to upstream behaviour (title + first author only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @matheusfillipe, and @therobbiedavis for the detailed plan. I've just opened #1054 (draft), which reworks the book searches: the rules for finding a book on Audible now live in one place in the backend ( That PR is about identifying the book on Audible, not about picking releases from indexers, so it doesn't fix the case handled here. But step 4 of your plan (matching candidates to the requested audiobook) needs the same kind of rules on the release side. So if this is wanted, I think the proper fix is best done after #1054, so it can reuse that unified backend search instead of adding another set of rules. For reference, the case here comes from the author string: Audible credits Marche ou crève to "Stephen King (alias Richard Bachman)", and title + that author finds nothing on my indexers, while title + "Stephen King" finds the same releases as the title-only retry. That's the "known aliases" part of step 1. EDIT : In fact modifying rules will not impact backend search refactoring, we should pursue the dev of improving matching and changing matching rules. |
|
Should we close this PR in favor of #1072 Retry automatic search without the author when the full query returns nothing ? |
Yes, I think that one needs less work and the OP already stated they were not interested in continuing to pursue the root cause fix. |
Automatic search builds one query from the title plus the author, and gives up if it comes back empty. Audible titles often carry a suffix like (Part 1 of 2) or (Dramatized Adaptation), and the author usually does not appear in release names, so that combined query matches nothing at the indexers.
Refs #801.