diff --git a/Arrs_Stack/radarr_classification_scan.sh b/Arrs_Stack/radarr_classification_scan.sh index 6ed0f0e..8d4d0b7 100755 --- a/Arrs_Stack/radarr_classification_scan.sh +++ b/Arrs_Stack/radarr_classification_scan.sh @@ -352,6 +352,16 @@ if [[ "$MOVE_MODE" == true ]]; then fi done < <(echo "$MOVE_TARGETS" | jq -c '.[]') + # arr_get_tracked_data() is cache-first — every write above changed rootFolderPath, so the + # shared cache is now stale until the next scheduled arr_cache_prefill run (up to 30min). + # Every other script reading this cache (cleanup, discovery, etc.) would see wrong data + # until then — refresh it now with one more live fetch rather than leave that window open. + if [[ "$MOVED" -gt 0 ]]; then + info "Refreshing shared tracked-data cache..." + fresh_movies=$(arr_api "$RADARR_URL" "$RADARR_API_KEY" "v3" "movie" "Radarr") + [[ -n "$fresh_movies" ]] && arr_cache_write "radarr" "$fresh_movies" + fi + echo "" echo "━━━━━ $ICON_SUMMARY MOVE SUMMARY ━━━━━" echo "$ICON_SUCCESS Moved: $MOVED"