Skip to content

feat(search): configurable automatic-search interval, per-book delay, title-only fallback#714

Open
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:feat/automatic-search-tuning
Open

feat(search): configurable automatic-search interval, per-book delay, title-only fallback#714
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:feat/automatic-search-tuning

Conversation

@kevinheneveld

Copy link
Copy Markdown
Contributor

Summary

The automatic-search background sweep ran on a hardcoded 6-hour cadence and searched every wanted book back-to-back with no throttle. On a large wanted list that hammers the indexers (and a shared Prowlarr). This adds three ApplicationSettings, read fresh each sweep so changes take effect without a restart:

  • AutomaticSearchIntervalHours (default 24, clamped [1,168]) — sweep cadence, via the service's intervalProvider. Also drives the "not searched since" cutoff so a book isn't re-searched more often than the configured interval.
  • AutomaticSearchBookDelaySeconds (default 5, clamped [0,300]) — delay between per-book searches during the sweep. 0 disables it. Manual "Search now" is unaffected.
  • AutomaticSearchTitleOnlyFallback (default true) — when the full Title Author Series query returns nothing, retry once with a title-only query to catch loosely-named releases. Doubles indexer queries for unfound books, so it's opt-out on the background sweep.

Changes

  • ApplicationSettings: 3 new properties + migration AddAutomaticSearchTuning (column defaults 24/5/true so the existing singleton row is correct) + snapshot.
  • AutomaticSearchService: interval now read from settings each cycle (GetSearchInterval, clamped, 24h fallback on error).
  • AutomaticSearchProcessor: reads the settings, applies the per-book delay in the sweep loop, and the interval-aware cutoff.
  • ProcessAudiobookAsync + AutomaticSearchResultClassifier.BuildTitleOnlySearchQuery: the title-only fallback retry.

Testing

dotnet build clean (0 warnings/0 errors); full suite green (1015 passed), including the migration/model-snapshot integration tests.

🤖 Generated with Claude Code

… title-only fallback

The automatic-search sweep ran on a hardcoded 6h cadence with no throttle. Add three
ApplicationSettings, read each sweep so changes take effect without a restart:

- AutomaticSearchIntervalHours (default 24, clamped [1,168]) — sweep cadence; also
  gates the "not searched since" cutoff so a book isn't re-searched more often than this.
- AutomaticSearchBookDelaySeconds (default 5, clamped [0,300]) — delay between per-book
  searches so a large wanted list doesn't hammer the indexers. Manual search is untouched.
- AutomaticSearchTitleOnlyFallback (default true) — when the full "Title Author Series"
  query finds nothing, retry with a title-only query (opt-out on the background sweep).

Migration adds the columns with those defaults so the existing settings row is correct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kevinheneveld kevinheneveld requested a review from a team July 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant