added manual neuclear option to arrs cleanup

This commit is contained in:
2026-04-26 01:05:22 -04:00
parent f826672b80
commit 3df4542351
11 changed files with 988 additions and 97 deletions
+24 -1
View File
@@ -1,10 +1,18 @@
#!/bin/bash
# -----------------------------------------------------------------------------------------------
# --------------------------------- Arrs Failed Stalled Recovery ----------------------------------------
# --------------------------------- Arrs Failed Stalled Recovery --------------------------------
# -----------------------------------------------------------------------------------------------
# Automatically detects and recovers from failed imports and stalled downloads
# across Sonarr, Radarr, and Lidarr. Blocklists the bad release and triggers
# a new search — hands free recovery while you sleep.
# Schedule: 0 */6 * * * (every 6 hours)
#
# What it checks (per-arr toggles in Master.conf):
# HOST1: Sonarr (Tv_Shows) — /api/v3/
# HOST1: Radarr (Movies) — /api/v3/
# HOST1: Lidarr (Music) — /api/v1/ ← HOST1 only, exits cleanly on HOST2
# HOST2: Sonarr (Anime_Shows) — /api/v3/
# HOST2: Radarr (Anime_Movies) — /api/v3/
#
# Targets four problem types from the queue API:
# importFailed — downloaded successfully but arr couldn't import the file
@@ -12,6 +20,7 @@
# error status — serious failure not covered by importFailed/importPending
# stalled — download stuck with no connections or no progress
#
# Items newer than ARR_IMPORT_RECOVERY_AGE (6hr) are skipped — gives arr time to retry.
# Never touches items with state "downloading" or "imported" — safe to run anytime.
#
# Action per problem item:
@@ -19,6 +28,12 @@
# 2. Remove from queue — cleans up the failed item
# 3. Trigger new search — finds a different release automatically
#
# Configuration in Master.conf:
# ARR_IMPORT_RECOVERY_AGE — hours before item is eligible
# HOST1/2_SONARR_RECOVERY — enable/disable per arr
# HOST1/2_RADARR_RECOVERY — enable/disable per arr
# HOST1_LIDARR_RECOVERY — enable/disable Lidarr (HOST1 only)
#
# Age threshold (ARR_IMPORT_RECOVERY_AGE):
# Items newer than threshold are skipped — gives the arr time to retry on its own
# Items older than threshold have not self-resolved — safe to intervene
@@ -357,4 +372,12 @@ elif [[ "$TOTAL_ACTIONED" -gt 0 ]]; then
else
echo "$ICON_DONE Status: $ICON_SUCCESS DONE — nothing to recover"
fi
# Write stats for sunday_morning_coffee_report.sh
if [[ "$DRY_RUN" == false ]] && [[ -n "${ARR_RECOVERY_STATS:-}" ]]; then
DATE=$(date '+%Y-%m-%d')
TIME=$(date '+%H:%M')
echo "${DATE}|${TIME}|${TOTAL_ACTIONED}|${TOTAL_SKIPPED}" \
>> "$ARR_RECOVERY_STATS" 2>/dev/null || true
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"