Script audit: fix stale names, header mismatches, HOST1-hardcoded path maps in lidarr scripts

This commit is contained in:
Gmer4Lfe
2026-06-27 13:42:06 -04:00
parent c9a0ad187b
commit 0401d872e4
5 changed files with 17 additions and 15 deletions
+5 -4
View File
@@ -197,11 +197,12 @@ fi
DOCKER_TIMEOUT=15
LIDARR_CONTAINER="Lidarr" # container name on HOST1
# Build path map from HOST1_LIDARR_PATH_MAP for translate_path()
# Build path map from MY_ID's Lidarr path map
declare -A ARR_PATH_MAP
for key in "${!HOST1_LIDARR_PATH_MAP[@]}"; do
ARR_PATH_MAP["$key"]="${HOST1_LIDARR_PATH_MAP[$key]}"
done
local_path_map_var="${MY_ID}_LIDARR_PATH_MAP"
eval "for key in \"\${!${local_path_map_var}[@]}\"; do
ARR_PATH_MAP[\"\$key\"]=\"\${${local_path_map_var}[\$key]}\"
done"
# Validate required vars — detect_hosts() should have set these
require_var LIDARR_URL
+8 -7
View File
@@ -113,19 +113,20 @@ acquire_lock
detect_hosts
# Build path map for translate_path() — container path → host path
declare -A ARR_PATH_MAP
for _key in "${!HOST1_LIDARR_PATH_MAP[@]}"; do
ARR_PATH_MAP["$_key"]="${HOST1_LIDARR_PATH_MAP[$_key]}"
done
unset _key
# HOST guard — Lidarr runs on HOST1 only
if [[ -z "$LIDARR_URL" ]]; then
echo "Lidarr not configured for $MY_ID — skipping"
exit 0
fi
# Build path map from MY_ID's Lidarr path map
declare -A ARR_PATH_MAP
local_path_map_var="${MY_ID}_LIDARR_PATH_MAP"
eval "for _key in \"\${!${local_path_map_var}[@]}\"; do
ARR_PATH_MAP[\"\$_key\"]=\"\${${local_path_map_var}[\$_key]}\"
done"
unset _key
info "$MY_ID ($LOCAL_SERVER_NAME) — tools OK"
log "$ICON_GEAR Config: url=${LIDARR_URL}"
+1 -1
View File
@@ -5,7 +5,7 @@
#
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Triggered by Sonarr/Radarr/Lidarr OnUpgrade webhook (via webhook.php).
# Triggered by Sonarr/Radarr/Lidarr OnUpgrade webhook (via webhook_listener.js).
# Pushes the upgraded item folder to every other mesh node immediately, then
# triggers a library rescan on each remote arr so it accepts the new file as
# ground truth without initiating a redundant quality search.