v1.0.98 - Reduce api calls to service and speed up process

pull/16/head
RandomNinjaAtk 2 years ago committed by GitHub
parent f72a5b0400
commit 9fb44f9969
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.97" scriptVersion="1.0.98"
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=""
@ -285,7 +285,8 @@ AddDeezerArtistToLidarr () {
DArtistAlbumList () { DArtistAlbumList () {
albumcount="$(python3 /config/extended/scripts/discography.py "$1" | sort -u | wc -l)" albumids=$(python3 /config/extended/scripts/discography.py "$1" | sort -u)
albumcount="$(echo "$albumids" | wc -l)"
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: Searching Artist ID \"$1\" for All Albums...." log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: Searching Artist ID \"$1\" for All Albums...."
if [ $albumcount -gt 0 ]; then if [ $albumcount -gt 0 ]; then
@ -294,7 +295,7 @@ DArtistAlbumList () {
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: ERROR :: $albumcount Albums found, skipping..." log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: ERROR :: $albumcount Albums found, skipping..."
return return
fi fi
albumids=($(python3 /config/extended/scripts/discography.py "$1" | sort -u)) albumids=($(echo "$albumids"))
for id in ${!albumids[@]}; do for id in ${!albumids[@]}; do
currentprocess=$(( $id + 1 )) currentprocess=$(( $id + 1 ))

Loading…
Cancel
Save