Fix Emby auth header and arr cleanup pre-flight scan
Emby 4.9.5 rejects X-Api-Key — notify_emby_scan() now uses X-Emby-Token consistently with emby_api(). Radarr v6 changed DownloadedMoviesScan to require a path parameter — both cleanup scripts now use ProcessMonitoredDownloads which achieves the same pre-flight intent without a path.
This commit is contained in:
@@ -336,8 +336,8 @@ fi
|
|||||||
|
|
||||||
info "Scan targets (${#SCAN_ROOTS[@]}): ${SCAN_ROOTS[*]}"
|
info "Scan targets (${#SCAN_ROOTS[@]}): ${SCAN_ROOTS[*]}"
|
||||||
|
|
||||||
info "Triggering DownloadedMoviesScan (all root folders)"
|
info "Triggering ProcessMonitoredDownloads pre-flight"
|
||||||
SCAN_PAYLOAD='{"name": "DownloadedMoviesScan"}'
|
SCAN_PAYLOAD='{"name": "ProcessMonitoredDownloads"}'
|
||||||
|
|
||||||
SCAN_RESPONSE=$(curl -sf --max-time 30 -X POST \
|
SCAN_RESPONSE=$(curl -sf --max-time 30 -X POST \
|
||||||
-H "X-Api-Key: $RADARR_API_KEY" \
|
-H "X-Api-Key: $RADARR_API_KEY" \
|
||||||
|
|||||||
@@ -336,8 +336,8 @@ fi
|
|||||||
|
|
||||||
info "Scan targets (${#SCAN_ROOTS[@]}): ${SCAN_ROOTS[*]}"
|
info "Scan targets (${#SCAN_ROOTS[@]}): ${SCAN_ROOTS[*]}"
|
||||||
|
|
||||||
info "Triggering DownloadedEpisodesScan (all root folders)"
|
info "Triggering ProcessMonitoredDownloads pre-flight"
|
||||||
SCAN_PAYLOAD='{"name": "DownloadedEpisodesScan"}'
|
SCAN_PAYLOAD='{"name": "ProcessMonitoredDownloads"}'
|
||||||
|
|
||||||
SCAN_RESPONSE=$(curl -sf --max-time 30 -X POST \
|
SCAN_RESPONSE=$(curl -sf --max-time 30 -X POST \
|
||||||
-H "X-Api-Key: $SONARR_API_KEY" \
|
-H "X-Api-Key: $SONARR_API_KEY" \
|
||||||
|
|||||||
@@ -1666,7 +1666,7 @@ notify_emby_scan() {
|
|||||||
# Get all scheduled tasks
|
# Get all scheduled tasks
|
||||||
local tasks_response
|
local tasks_response
|
||||||
tasks_response=$(curl -sf --max-time 15 \
|
tasks_response=$(curl -sf --max-time 15 \
|
||||||
-H "X-Api-Key: $EMBY_API_KEY" \
|
-H "X-Emby-Token: $EMBY_API_KEY" \
|
||||||
"${EMBY_URL}/ScheduledTasks" 2>/dev/null)
|
"${EMBY_URL}/ScheduledTasks" 2>/dev/null)
|
||||||
|
|
||||||
if [[ -z "$tasks_response" ]]; then
|
if [[ -z "$tasks_response" ]]; then
|
||||||
@@ -1702,7 +1702,7 @@ notify_emby_scan() {
|
|||||||
local http_code
|
local http_code
|
||||||
http_code=$(curl -sf --max-time 15 \
|
http_code=$(curl -sf --max-time 15 \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "X-Api-Key: $EMBY_API_KEY" \
|
-H "X-Emby-Token: $EMBY_API_KEY" \
|
||||||
-w "%{http_code}" \
|
-w "%{http_code}" \
|
||||||
-o /dev/null \
|
-o /dev/null \
|
||||||
"${EMBY_URL}/ScheduledTasks/Running/${task_id}" 2>/dev/null)
|
"${EMBY_URL}/ScheduledTasks/Running/${task_id}" 2>/dev/null)
|
||||||
|
|||||||
Reference in New Issue
Block a user