From 3b50c7817321dbbabbc2b83f5d0ce8a0efd969f9 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Sat, 3 Jun 2023 09:19:28 -0400 Subject: [PATCH] 1.0.8 - pause for any running task #248 --- root/scripts/Video.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/scripts/Video.sh b/root/scripts/Video.sh index 9917ebf..7544da8 100644 --- a/root/scripts/Video.sh +++ b/root/scripts/Video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.7" +scriptVersion="1.0.8" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -419,8 +419,8 @@ 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) - if [ "$taskCount" -ge "3" ]; then + taskCount=$(curl -s "$lidarrUrl/api/v1/command?apikey=${lidarrApiKey}" | jq -r '.[] | select(.status=="started") | .name' | wc -l) + if [ "$taskCount" -ge "1" ]; then if [ "$alerted" = "no" ]; then alerted=yes log "STATUS :: LIDARR BUSY :: Pausing/waiting for all active Lidarr tasks to end..."