From 3f8436185bc6690c36ca7be712aa640c024348b8 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 3 Feb 2023 17:09:57 -0500 Subject: [PATCH] 1.0.309 - Ignore RescanFolder tasks when pausing to wait for Lidarr #132 This is a workaround but should resolve it by allowing the script to continue forward progress and ignore the RescanFolders task.... --- root/scripts/Audio.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/scripts/Audio.sh b/root/scripts/Audio.sh index 5044568..5d73b72 100644 --- a/root/scripts/Audio.sh +++ b/root/scripts/Audio.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.308" +scriptVersion="1.0.309" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" == "null" ]; then @@ -1835,7 +1835,7 @@ LidarrTaskStatusCheck () { alerted=no until false do - taskCount=$(curl -s "$lidarrUrl/api/v1/command?apikey=${lidarrApiKey}" | jq -r .[].status | grep -v completed | grep -v failed | wc -l) + taskCount=$(curl -s "$lidarrUrl/api/v1/command?apikey=${lidarrApiKey}" | jq -r '.[] | select(.status=="started") | .name' | grep -v "RescanFolders" | wc -l) if [ "$taskCount" -ge "1" ]; then if [ "$alerted" == "no" ]; then alerted=yes