Commit c4792f8
fix(search): apply RelevanceFilter in DownloadService and LibraryController auto-pick flows too
The previous commit wired the context-aware RelevanceFilter into
AutomaticSearchService only. The two other auto-pick callers
(DownloadService.SearchAndDownloadAsync via the manual "search and
download" endpoint, and LibraryController.ProcessAudiobookForSearchAsync
via the bulk-search-all endpoint) bypassed the filter and went straight
from search to scoring — so they could still pick an irrelevant result
when the indexer returned only weak matches.
DownloadService injects SearchResultFilterPipeline via its primary
constructor; LibraryController resolves it from the existing scope
factory to avoid widening its constructor. Both call
pipeline.ApplyFilters(searchResults, audiobook: audiobook) before
ScoreSearchResults, matching the AutomaticSearchService pattern.
Manual search (no audiobook context) keeps the old behavior — the
filter fails open without context.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent fdb44cb commit c4792f8
2 files changed
Lines changed: 44 additions & 1 deletion
File tree
- listenarr.api/Controllers
- listenarr.application/Downloads
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3195 | 3195 | | |
3196 | 3196 | | |
3197 | 3197 | | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
3198 | 3222 | | |
3199 | 3223 | | |
3200 | 3224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
209 | 228 | | |
210 | 229 | | |
211 | 230 | | |
| |||
0 commit comments