Generalize tracked-data cache from Lidarr-only to all three arrs

Shared cache/rescan-duration logic in common.sh now takes an arr_type
param instead of being Lidarr-specific, so Sonarr and Radarr cleanup
scripts get the same cache-first fetch + rescan-aware retry Lidarr had.
Avoids redundant full-library API calls across scripts run back to back,
and stops false failures when a fetch lands mid-rescan.
This commit is contained in:
Gmer4Lfe
2026-07-16 15:34:56 -04:00
parent 62bb166f9a
commit c7ecf99c3f
10 changed files with 430 additions and 236 deletions
+2 -2
View File
@@ -307,8 +307,8 @@ ALL_ARTISTS=$(lidarr_api "artist") || {
exit 1
}
# Write-through — keeps the shared tracked-data cache fresh as a side effect of a fetch
# this script already needed for its own purposes. See lidarr_get_tracked_data() in common.sh.
lidarr_cache_write "$ALL_ARTISTS"
# this script already needed for its own purposes. See arr_get_tracked_data() in common.sh.
arr_cache_write "lidarr" "$ALL_ARTISTS"
while IFS= read -r artist; do
aid=$(echo "$artist" | jq -r '.id')