Add Sonarr discovery; wire search commands to all arr adds
- New: Media/playback_aware_sonarr_discovery.sh — two-stage TV show discovery using Emby episode play history → TMDB TV recommendations. Multi-user aware: diversity score (0-50) is primary seed driver so one user binge-watching alone cannot dominate. Per-user episode cap (default 8) limits single-user volume contribution. TMDB→TVDB via external_ids for reliable Sonarr lookup. monitor=future by default. - Add to WEEKLY_MAINTENANCE_SCRIPTS; Sonarr discovery config block in master.conf (threshold=52, lookback=14d, max_adds=3, user_ep_cap=8). - Fix: all arr add scripts were not triggering searches after adding. Added _radarr_command/_lidarr_command/_sonarr_command helpers and fire MoviesSearch/ArtistSearch/SeriesSearch immediately after each successful add. Affects: playback_aware_radarr_discovery.sh, emby_to_lidarr_sync.sh, emby_to_radarr_sync.sh, emby_to_sonarr_sync.sh.
This commit is contained in:
@@ -100,6 +100,14 @@ _sonarr_post() {
|
||||
"${SONARR_URL}/api/v3/series" 2>/dev/null
|
||||
}
|
||||
|
||||
_sonarr_command() {
|
||||
curl -sf --max-time 20 -X POST \
|
||||
-H "X-Api-Key: $SONARR_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$1" \
|
||||
"${SONARR_URL}/api/v3/command" 2>/dev/null
|
||||
}
|
||||
|
||||
# Garbage title filter — catches multi-season folder names and bare fansub tags.
|
||||
_is_garbage_title() {
|
||||
local t="$1"
|
||||
@@ -283,6 +291,8 @@ for name in "${SORTED_MISSING[@]}"; do
|
||||
RESULT=$(_sonarr_post "$PAYLOAD")
|
||||
|
||||
if echo "$RESULT" | jq -e '.id' >/dev/null 2>&1; then
|
||||
SERIES_ID=$(echo "$RESULT" | jq -r '.id')
|
||||
_sonarr_command "{\"name\":\"SeriesSearch\",\"seriesId\":${SERIES_ID}}" >/dev/null
|
||||
log " $ICON_DONE Added: $SONARR_TITLE"
|
||||
(( ADDED++ ))
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user