v1.0.72 - Logging enhancements

pull/16/head
RandomNinjaAtk 3 years ago committed by GitHub
parent 5983123576
commit 19765e3397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.0.71" scriptVersion="1.0.72"
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" = "null" ]; then if [ "$lidarrUrlBase" = "null" ]; then
lidarrUrlBase="" lidarrUrlBase=""
@ -670,8 +670,7 @@ LidarrRootFolderCheck () {
} }
GetMissingCutOffList () { GetMissingCutOffList () {
log ":: Downloading missing list..."
if [ -d /config/extended/cache/missing ]; then if [ -d /config/extended/cache/missing ]; then
rm -rf /config/extended/cache/missing rm -rf /config/extended/cache/missing
fi fi
@ -1164,6 +1163,7 @@ CheckLidarrBeforeImport () {
} }
AddRelatedArtists () { AddRelatedArtists () {
log ":: Begin adding Lidarr related Artists from Deezer..."
lidarrArtistsData="$(curl -s "$lidarrUrl/api/v1/artist?apikey=${lidarrApiKey}")" lidarrArtistsData="$(curl -s "$lidarrUrl/api/v1/artist?apikey=${lidarrApiKey}")"
lidarrArtistTotal=$(echo "${lidarrArtistsData}"| jq -r '.[].sortName' | wc -l) lidarrArtistTotal=$(echo "${lidarrArtistsData}"| jq -r '.[].sortName' | wc -l)
lidarrArtistList=($(echo "${lidarrArtistsData}" | jq -r ".[].foreignArtistId")) lidarrArtistList=($(echo "${lidarrArtistsData}" | jq -r ".[].foreignArtistId"))
@ -1181,13 +1181,12 @@ AddRelatedArtists () {
deezerArtistUrl=$(echo "${lidarrArtistData}" | jq -r ".links | .[] | select(.name==\"deezer\") | .url") deezerArtistUrl=$(echo "${lidarrArtistData}" | jq -r ".links | .[] | select(.name==\"deezer\") | .url")
deezerArtistIds=($(echo "$deezerArtistUrl" | grep -o '[[:digit:]]*' | sort -u)) deezerArtistIds=($(echo "$deezerArtistUrl" | grep -o '[[:digit:]]*' | sort -u))
lidarrArtistMonitored=$(echo "${lidarrArtistData}" | jq -r ".monitored") lidarrArtistMonitored=$(echo "${lidarrArtistData}" | jq -r ".monitored")
log ":: Adding Related Artists for $lidarrArtistName" log ":: $artistNumber of $lidarrArtistTotal :: $lidarrArtistName :: Adding Related Artists..."
if [ $lidarrArtistMonitored = false ]; then if [ $lidarrArtistMonitored = false ]; then
log ":: Artist is not monitored :: skipping..." log ":: $artistNumber of $lidarrArtistTotal :: $lidarrArtistName :: Artist is not monitored :: skipping..."
continue continue
fi fi
for dId in ${!deezerArtistIds[@]}; do for dId in ${!deezerArtistIds[@]}; do
deezerArtistId="${deezerArtistIds[$dId]}" deezerArtistId="${deezerArtistIds[$dId]}"
deezerRelatedArtistData=$(curl -sL --fail "https://api.deezer.com/artist/$deezerArtistId/related?limit=$numberOfRelatedArtistsToAddPerArtist"| jq -r ".data | sort_by(.nb_fan) | reverse | .[]") deezerRelatedArtistData=$(curl -sL --fail "https://api.deezer.com/artist/$deezerArtistId/related?limit=$numberOfRelatedArtistsToAddPerArtist"| jq -r ".data | sort_by(.nb_fan) | reverse | .[]")

Loading…
Cancel
Save