Description
The LidarrTaskStatusCheck function in Audio.service.bash polls the Lidarr command API and waits until all started commands complete before proceeding. However, ProcessMonitoredDownloads is an internal Lidarr background task with isLongRunning: true that runs continuously and never finishes. This causes the Audio script to hang indefinitely at:
STATUS :: LIDARR BUSY :: Pausing/waiting for all active Lidarr tasks to end...
Root Cause
File: lidarr/Audio.service.bash, LidarrTaskStatusCheck function
taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq -r '.[] | select(.status=="started") | .name' | wc -l)
The Lidarr API returns ProcessMonitoredDownloads with "status": "started" and "body": {"isLongRunning": true}. Since this task never transitions to completed, taskCount is always ≥ 1 and the loop never breaks.
Symptoms
- Audio script permanently stuck at "LIDARR BUSY" after any Lidarr restart
- All queued Lidarr commands (MoveArtist, RescanFolders, DownloadedAlbumsScan) pile up and never run
- No downloads are processed until the container is restarted
Fix
Filter out long-running commands from the task count:
taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq '[.[] | select(.status=="started") | select(.body.isLongRunning != true)] | length')
This excludes ProcessMonitoredDownloads (and any other future long-running background tasks) while still correctly waiting for user-initiated tasks like RefreshArtist, DownloadedAlbumsScan, etc.
Environment
- Lidarr v2.13.x
- arr-scripts v2.48
- linuxserver/lidarr container
Description
The
LidarrTaskStatusCheckfunction inAudio.service.bashpolls the Lidarr command API and waits until allstartedcommands complete before proceeding. However,ProcessMonitoredDownloadsis an internal Lidarr background task withisLongRunning: truethat runs continuously and never finishes. This causes the Audio script to hang indefinitely at:Root Cause
File:
lidarr/Audio.service.bash,LidarrTaskStatusCheckfunctiontaskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq -r '.[] | select(.status=="started") | .name' | wc -l)The Lidarr API returns
ProcessMonitoredDownloadswith"status": "started"and"body": {"isLongRunning": true}. Since this task never transitions tocompleted,taskCountis always ≥ 1 and the loop never breaks.Symptoms
Fix
Filter out long-running commands from the task count:
taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq '[.[] | select(.status=="started") | select(.body.isLongRunning != true)] | length')This excludes
ProcessMonitoredDownloads(and any other future long-running background tasks) while still correctly waiting for user-initiated tasks likeRefreshArtist,DownloadedAlbumsScan, etc.Environment