Skip to content

Commit 5738fdd

Browse files
v1.8 - Bug fix for last change... Not sure why... though...?
1 parent f022675 commit 5738fdd

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

sabnzbd/video.bash

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
scriptVersion="1.7"
2+
scriptVersion="1.8"
33
scriptName="Video"
44

55
#### Import Settings
@@ -11,7 +11,6 @@ log () {
1111
}
1212

1313
set -e
14-
set -o pipefail
1514

1615
# auto-clean up log file to reduce space usage
1716
if [ -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

0 commit comments

Comments
 (0)