1.0.3 - reset agent to default, increase length between queries

pull/250/head
RandomNinjaAtk 1 year ago committed by GitHub
parent 42519d9a67
commit 7a4a508d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.2"
scriptVersion="1.0.3"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" == "null" ]; then
@ -12,8 +12,9 @@ if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrPort="$(cat /config/config.xml | xq | jq -r .Config.Port)"
lidarrUrl="http://localhost:${lidarrPort}${lidarrUrlBase}"
fi
agent="${lidarrAgentInstanceId} ( https://github.com/RandomNinjaAtk/docker-lidarr-extended )"
agent="lidarr-extended ( https://github.com/RandomNinjaAtk/docker-lidarr-extended )"
musicbrainzMirror=https://musicbrainz.org
musicbrainzSleep=5
# Debugging settings
#addRelatedArtists="true"
@ -94,16 +95,16 @@ AddDeezerArtistToLidarr () {
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22https://www.deezer.com/artist/${deezerArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
if [ "$count" == "0" ]; then
sleep 2
sleep $musicbrainzSleep
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22http://www.deezer.com/artist/${deezerArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
sleep 2
sleep $musicbrainzSleep
fi
if [ "$count" == "0" ]; then
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22http://deezer.com/artist/${deezerArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
sleep 2
sleep $musicbrainzSleep
fi
if [ "$count" == "0" ]; then
@ -113,7 +114,7 @@ AddDeezerArtistToLidarr () {
if [ "$count" != "0" ]; then
musicbrainz_main_artist_id=$(echo "$query_data" | jq -r '.urls[]."relation-list"[].relations[].artist.id' | head -n 1)
sleep 2
sleep $musicbrainzSleep
artist_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/artist/$musicbrainz_main_artist_id?fmt=json")
artist_sort_name="$(echo "$artist_data" | jq -r '."sort-name"')"
artist_formed="$(echo "$artist_data" | jq -r '."begin-area".name')"
@ -208,7 +209,7 @@ LidarrTaskStatusCheck () {
alerted=yes
log "STATUS :: LIDARR BUSY :: Pausing/waiting for all active Lidarr tasks to end..."
fi
sleep 2
sleep $musicbrainzSleep
else
break
fi
@ -269,19 +270,19 @@ AddTidalArtistToLidarr () {
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22https://listen.tidal.com/artist/${serviceArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
if [ "$count" == "0" ]; then
sleep 2
sleep $musicbrainzSleep
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22http://listen.tidal.com/artist/${serviceArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
fi
if [ "$count" == "0" ]; then
sleep 2
sleep $musicbrainzSleep
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22https://tidal.com/artist/${serviceArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
fi
if [ "$count" == "0" ]; then
sleep 2
sleep $musicbrainzSleep
query_data=$(curl -s -A "$agent" "https://musicbrainz.org/ws/2/url?query=url:%22http://tidal.com/artist/${serviceArtistId}%22&fmt=json")
count=$(echo "$query_data" | jq -r ".count")
fi

Loading…
Cancel
Save