v1.0.89 - Reduce api calls needed...

pull/16/head
RandomNinjaAtk 3 years ago committed by GitHub
parent a4e1b034cd
commit 070b74d5fd
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.88" scriptVersion="1.0.89"
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=""
@ -13,10 +13,10 @@ musicbrainzMirror=https://musicbrainz.org
# Debugging settings # Debugging settings
#dlClientSource=deezer #dlClientSource=deezer
#topLimit=25 #topLimit=3
#addDeezerTopArtists=false #addDeezerTopArtists=true
#addDeezerTopAlbumArtists=false #addDeezerTopAlbumArtists=true
#addDeezerTopTrackArtists=false #addDeezerTopTrackArtists=true
#configureLidarrWithOptimalSettings=false #configureLidarrWithOptimalSettings=false
#audioFormat=opus #audioFormat=opus
#audioBitrate=160 #audioBitrate=160
@ -165,24 +165,27 @@ DownloadFormat () {
} }
AddDeezerTopArtists () { AddDeezerTopArtists () {
getDeezerArtistsIds=($(curl -s "https://api.deezer.com/chart/0/artists?limit=$1" | jq -r ".data[].id")) getDeezerArtistsIds=$(curl -s "https://api.deezer.com/chart/0/artists?limit=$1" | jq -r ".data[].id")
getDeezerArtistsIdsCount=$(curl -s "https://api.deezer.com/chart/0/artists?limit=$1" | jq -r ".data[].id" | wc -l) getDeezerArtistsIdsCount=$(echo "$getDeezerArtistsIds" | wc -l)
getDeezerArtistsIds=($(echo "$getDeezerArtistsIds"))
sleep $sleepTimer sleep $sleepTimer
description="Top Artists" description="Top Artists"
AddDeezerArtistToLidarr AddDeezerArtistToLidarr
} }
AddDeezerTopAlbumArtists () { AddDeezerTopAlbumArtists () {
getDeezerArtistsIds=($(curl -s "https://api.deezer.com/chart/0/albums?limit=$1" | jq -r ".data[].artist.id")) getDeezerArtistsIds=$(curl -s "https://api.deezer.com/chart/0/albums?limit=$1" | jq -r ".data[].artist.id")
getDeezerArtistsIdsCount=$(curl -s "https://api.deezer.com/chart/0/albums?limit=$1" | jq -r ".data[].artist.id" | wc -l) getDeezerArtistsIdsCount=$(echo "$getDeezerArtistsIds" | wc -l)
getDeezerArtistsIds=($(echo "$getDeezerArtistsIds"))
sleep $sleepTimer sleep $sleepTimer
description="Top Album Artists" description="Top Album Artists"
AddDeezerArtistToLidarr AddDeezerArtistToLidarr
} }
AddDeezerTopTrackArtists () { AddDeezerTopTrackArtists () {
getDeezerArtistsIds=($(curl -s "https://api.deezer.com/chart/0/tracks?limit=$1" | jq -r ".data[].artist.id")) getDeezerArtistsIds=$(curl -s "https://api.deezer.com/chart/0/tracks?limit=$1" | jq -r ".data[].artist.id")
getDeezerArtistsIdsCount=$(curl -s "https://api.deezer.com/chart/0/tracks?limit=$1" | jq -r ".data[].artist.id" | wc -l) getDeezerArtistsIdsCount=$(echo "$getDeezerArtistsIds" | wc -l)
getDeezerArtistsIds=($(echo "$getDeezerArtistsIds"))
sleep $sleepTimer sleep $sleepTimer
description="Top Track Artists" description="Top Track Artists"
AddDeezerArtistToLidarr AddDeezerArtistToLidarr

Loading…
Cancel
Save