From 938bd217ec877b8023483dcf48d6eb79f4cf5891 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Sun, 13 Aug 2023 16:15:50 -0400 Subject: [PATCH] Update TidalVideo.bash --- lidarr/TidalVideo.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lidarr/TidalVideo.bash b/lidarr/TidalVideo.bash index 7b3e79b..98c9af0 100644 --- a/lidarr/TidalVideo.bash +++ b/lidarr/TidalVideo.bash @@ -155,6 +155,23 @@ AddFeaturedVideoArtists () { } +LidarrTaskStatusCheck () { + alerted=no + until false + do + taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | 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..." + fi + sleep 2 + else + break + fi + done +} + TidalClientSetup AddFeaturedVideoArtists