File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- scriptVersion=" 1.7 "
2+ scriptVersion=" 1.8 "
33scriptName=" Video"
44
55# ### Import Settings
@@ -11,7 +11,6 @@ log () {
1111}
1212
1313set -e
14- set -o pipefail
1514
1615# auto-clean up log file to reduce space usage
1716if [ -f " /config/scripts/video.txt" ]; then
@@ -126,18 +125,18 @@ ArrWaitForTaskCompletion () {
126125 alerted=no
127126 until false
128127 do
129- arrtasks= $( curl -s " $arrUrl /api/v3/command?apikey= ${arrApiKey} " | jq -r ' .[] | select(.status=="started") | .name ' )
130- taskCount=$( echo $arrtasks | wc -l)
131- arrProcessMonitoredDownloadsCount= $( echo $arrtasks | grep " ProcessMonitoredDownloads" | wc -l)
132- if [ " $taskCount " -ge 3 ] || [ " $arrProcessMonitoredDownloadsCount " -ge 1 ]; then
133- if [ " $alerted " == " no" ]; then
134- alerted=yes
135- log " $count of $fileCount :: STATUS :: ARR APP BUSY :: Pausing/waiting for all active Arr app tasks to end..."
136- fi
137- sleep 2
138- else
139- break
140- fi
128+ log " $count of $fileCount :: STATUS :: Checking ARR App Status "
129+ taskCount=$( curl -s " $arrUrl /api/v3/command?apikey= ${arrApiKey} " | jq -r ' .[] | select(.status=="started") | .name ' | wc -l)
130+ arrDownloadTaskCount= $( curl -s " $arrUrl /api/v3/command?apikey= ${arrApiKey} " | jq -r ' .[] | select(.status=="started") | .name ' | grep " ProcessMonitoredDownloads" | wc -l)
131+ if [ " $taskCount " -ge " 3 " ] || [ " $arrDownloadTaskCount " -ge " 1 " ]; then
132+ if [ " $alerted " == " no" ]; then
133+ alerted=yes
134+ log " $count of $fileCount :: STATUS :: ARR APP BUSY :: Pausing/waiting for all active Arr app tasks to end..."
135+ fi
136+ sleep 2
137+ else
138+ break
139+ fi
141140 done
142141}
143142
You can’t perform that action at this time.
0 commit comments