2.42 - Only add client and tag if not already added...

This commit is contained in:
RandomNinjaAtk
2024-04-12 20:54:03 -04:00
committed by GitHub
parent 52a1b74f8e
commit d23cc5fe41

View File

@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
scriptVersion="2.41"
scriptVersion="2.42"
scriptName="Audio"
### Import Settings
@@ -13,12 +13,15 @@ AddTag () {
}
AddDownloadClient () {
AddTag
if [ ! -d "$importPath" ]; then
mkdir -p "$importPath"
chmod 777 -R "$importPath"
fi
lidarrProcessIt=$(curl -s "$arrUrl/api/v1/downloadclient" --header "X-Api-Key:"${arrApiKey} -H "Content-Type: application/json" --data-raw "{\"enable\":true,\"protocol\":\"usenet\",\"priority\":10,\"removeCompletedDownloads\":true,\"removeFailedDownloads\":true,\"name\":\"Arr-Extended\",\"fields\":[{\"name\":\"nzbFolder\",\"value\":\"/config/extended/downloads/\"},{\"name\":\"watchFolder\",\"value\":\"$importPath\"}],\"implementationName\":\"Usenet Blackhole\",\"implementation\":\"UsenetBlackhole\",\"configContract\":\"UsenetBlackholeSettings\",\"infoLink\":\"https://wiki.servarr.com/lidarr/supported#usenetblackhole\",\"tags\":[]}")
downloadClientCheck=$(curl -s "$arrUrl/api/v1/downloadclient" --header "X-Api-Key:"${arrApiKey} -H "Content-Type: application/json")
if [ -z "$downloadClientCheck" ]; then
AddTag
if [ ! -d "$importPath" ]; then
mkdir -p "$importPath"
chmod 777 -R "$importPath"
fi
lidarrProcessIt=$(curl -s "$arrUrl/api/v1/downloadclient" --header "X-Api-Key:"${arrApiKey} -H "Content-Type: application/json" --data-raw "{\"enable\":true,\"protocol\":\"usenet\",\"priority\":10,\"removeCompletedDownloads\":true,\"removeFailedDownloads\":true,\"name\":\"Arr-Extended\",\"fields\":[{\"name\":\"nzbFolder\",\"value\":\"/config/extended/downloads/\"},{\"name\":\"watchFolder\",\"value\":\"$importPath\"}],\"implementationName\":\"Usenet Blackhole\",\"implementation\":\"UsenetBlackhole\",\"configContract\":\"UsenetBlackholeSettings\",\"infoLink\":\"https://wiki.servarr.com/lidarr/supported#usenetblackhole\",\"tags\":[]}")
fi
}
verifyConfig () {