Summary
The automatic search never queues a download for a book that has a series membership its own Series/SeriesNumber fields do not repeat, most commonly a book in a second series. It finds results, scores them, accepts one, and then drops it at the last check, on every pass.
AutomaticSearchService scores each book as GetMonitoredAudiobooksForSearchAsync loaded it. That query includes the quality profile but not SeriesMemberships. Just before StartDownloadAsync, IsCurrentAsync rebuilds the target fingerprint from GetByIdSnapshotAsync, which does include the memberships. BookMatchContext.From puts every membership into the fingerprint along with the book's own Series/SeriesNumber:
- With one series, the membership and the
Seriesfield give an equal series reference (ReleaseSeriesReferenceis a record),Distinct()merges them, and the two fingerprints match. - With a second series, that series exists only as a membership (the same holds for any membership the
Seriesfields do not repeat). The fingerprint built from the selection lacks it, the one built from the snapshot has it, they never match, andProcessAudiobookAsyncreturns 0 without starting the download.
Nothing about the book changed, so this is not the staleness the check exists to catch.
Changes
Fixed
GetMonitoredAudiobooksForSearchAsyncnow includesSeriesMemberships, so the fingerprint the search assesses and the oneIsCurrentAsyncrebuilds are built from the same facts.
Changed
- Apart from that include, the query is unchanged. It moves into a new partial,
AudiobookRepository.AutomaticSearch.cs, becauseAudiobookRepository.csis already at the 500-line cap thatBackendArchitectureTestsenforces. This follows the precedent ofAudiobookRepository.Blocklist.cs.
Added
AudiobookRepositoryAutomaticSearchSelectionTests: seeds a monitored book in one series and in two, selects it throughGetMonitoredAudiobooksForSearchAsync...
Automated Canary build