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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user