v1.0.165 - Additonal improvements to "CheckLidarrBeforeImport" process

pull/16/head
RandomNinjaAtk 2 years ago committed by GitHub
parent a6e7d0494e
commit 6df4e01ba1
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.164" scriptVersion="1.0.165"
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=""
@ -2020,8 +2020,9 @@ CheckLidarrBeforeImport () {
alreadyImported=false alreadyImported=false
if [ "$2" = "beets" ]; then if [ "$2" = "beets" ]; then
checkLidarrAlbumData=$(curl -s --header "X-Api-Key:"${lidarrApiKey} --request GET "$lidarrUrl/api/v1/album/" | jq -r ".[] | select(.foreignAlbumId==\"$1\")") getLidarrAlbumId=$(curl -s "$lidarrUrl/api/v1/search?term=lidarr%3A$1&apikey=$lidarrApiKey" | jq -r .[].album.releases[].albumId | sort -u)
checkLidarrAlbumPercentOfTracks=$(echo "$lidarrAlbumData" | jq -r ".statistics.percentOfTracks") checkLidarrAlbumData="$(curl -s "$lidarrUrl/api/v1/album/$getLidarrAlbumId?apikey=${lidarrApiKey}")"
checkLidarrAlbumPercentOfTracks=$(echo "$checkLidarrAlbumData" | jq -r ".statistics.percentOfTracks")
if [ "$checkLidarrAlbumPercentOfTracks" = "null" ]; then if [ "$checkLidarrAlbumPercentOfTracks" = "null" ]; then
checkLidarrAlbumPercentOfTracks=0 checkLidarrAlbumPercentOfTracks=0

Loading…
Cancel
Save