feat: search result feedback loop with grab detection#80
feat: search result feedback loop with grab detection#80menottim wants to merge 3 commits intofeat/search-loop-intelligencefrom
Conversation
e4b29cd to
5f00065
Compare
Introduces the search-result feedback loop service that polls Sonarr/Radarr command statuses after searches to determine whether content was grabbed. Updates LibraryItem.record_grab() on confirmed grabs and enriches SearchHistory.search_metadata with grab_confirmed flags. Includes 10 unit tests covering: missing history/instance, no searchable commands, Sonarr/Radarr grab confirmed/unconfirmed, incomplete commands, client exceptions with partial results, and invalid metadata handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds _execute_feedback_check method to SearchScheduler that creates a DB session and delegates to FeedbackCheckService. In execute_queue(), schedules a one-shot APScheduler job after successful search runs with searches_triggered > 0, delayed by feedback_check_delay_minutes (default 15min) to allow time for downloads to complete before checking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents SQLAlchemy session from being left in invalid state after a failed commit in _save_metadata. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59d341b to
959bfcf
Compare
Code reviewFound 1 issue:
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
Code reviewed and verified. Already merged to main via local merge (dec886d). Tests pass with no regressions (80 pre-existing failures, 663 passed). One logging issue noted in review comment — missing instance_id context fields on 3 log statements. |
Summary
New files
src/splintarr/services/feedback.py— FeedbackCheckServicetests/unit/test_feedback.py— 10 testsTest plan
🤖 Generated with Claude Code