From 9fb44f99693508ceebb14fe594fe944642f31670 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 8 Jul 2022 10:53:49 +0000 Subject: [PATCH] v1.0.98 - Reduce api calls to service and speed up process --- root/scripts/download.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/root/scripts/download.sh b/root/scripts/download.sh index ce45bae..e9e0df9 100644 --- a/root/scripts/download.sh +++ b/root/scripts/download.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.97" +scriptVersion="1.0.98" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" = "null" ]; then lidarrUrlBase="" @@ -285,7 +285,8 @@ AddDeezerArtistToLidarr () { 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...." if [ $albumcount -gt 0 ]; then @@ -294,7 +295,7 @@ DArtistAlbumList () { log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: ERROR :: $albumcount Albums found, skipping..." return fi - albumids=($(python3 /config/extended/scripts/discography.py "$1" | sort -u)) + albumids=($(echo "$albumids")) for id in ${!albumids[@]}; do currentprocess=$(( $id + 1 ))