v1.0.83 - bug fix to check for previous imports when not using beets

pull/16/head
RandomNinjaAtk 3 years ago committed by GitHub
parent 58e69bd30e
commit 335e56e4e7
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.82" scriptVersion="1.0.83"
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=""
@ -1220,6 +1220,22 @@ CheckLidarrBeforeImport () {
alreadyImported=true alreadyImported=true
return return
fi fi
lidarrAlbumData=$(curl -s --header "X-Api-Key:"${lidarrApiKey} --request GET "$lidarrUrl/api/v1/album/" | jq -r ".[] | select(.foreignAlbumId==\"$1\")")
lidarrCheckAlbumId=$(echo "$lidarrAlbumData" | jq -r ".id")
lidarrPercentOfTracks=$(echo "$lidarrAlbumData" | jq -r ".statistics.percentOfTracks")
if [ "$lidarrPercentOfTracks" = "null" ]; then
lidarrPercentOfTracks=0
return
fi
if [ $lidarrPercentOfTracks -gt 0 ]; then
if [ $wantedAlbumListSource = missing ]; then
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: ERROR :: Already Imported Album (Missing), skipping..."
alreadyImported=true
return
fi
fi
fi fi
} }

Loading…
Cancel
Save