From 9adeef4cd736a788fb1cb398a09a34de61e5e6ff Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 16 Aug 2022 11:17:26 +0000 Subject: [PATCH] v1.0.238 - Speed up... --- root/scripts/audio.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/root/scripts/audio.sh b/root/scripts/audio.sh index e061f17..bfb2d98 100644 --- a/root/scripts/audio.sh +++ b/root/scripts/audio.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.237" +scriptVersion="1.0.238" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" = "null" ]; then @@ -1001,15 +1001,28 @@ SearchProcess () { wantedAlbumListSource=$(echo $lidarrMissingId | sed -e "s%[^[:alpha:]]%%g") lidarrAlbumData="$(curl -s "$lidarrUrl/api/v1/album/$wantedAlbumId?apikey=${lidarrApiKey}")" lidarrArtistData=$(echo "${lidarrAlbumData}" | jq -r ".artist") + lidarrArtistName=$(echo "${lidarrArtistData}" | jq -r ".artistName") lidarrArtistForeignArtistId=$(echo "${lidarrArtistData}" | jq -r ".foreignArtistId") lidarrAlbumType=$(echo "$lidarrAlbumData" | jq -r ".albumType") lidarrAlbumTitle=$(echo "$lidarrAlbumData" | jq -r ".title") lidarrAlbumForeignAlbumId=$(echo "$lidarrAlbumData" | jq -r ".foreignAlbumId") if [ -f "/config/extended/logs/notfound/$wantedAlbumId--$lidarrArtistForeignArtistId--$lidarrAlbumForeignAlbumId" ]; then - log "$processNumber of $wantedListAlbumTotal :: $lidarrAlbumTitle :: $lidarrAlbumType :: Previously Not Found, skipping..." + log "$processNumber of $wantedListAlbumTotal :: $lidarrAlbumType :: $lidarrArtistName :: $lidarrAlbumTitle :: Previously Not Found, skipping..." continue fi + + if [ "$enableVideoScript" == "true" ]; then + if [ -d /config/extended/logs/video/complete ]; then + if [ -f "/config/extended/logs/video/complete/$lidarrArtistForeignArtistId" ]; then + log "$processNumber of $wantedListAlbumTotal :: $lidarrAlbumType :: $lidarrArtistName :: $lidarrAlbumTitle :: Skipping until all videos are processed for the artist..." + continue + fi + else + log "$processNumber of $wantedListAlbumTotal :: $lidarrAlbumType :: $lidarrArtistName :: $lidarrAlbumTitle :: Skipping until all videos are processed for the artist..." + continue + fi + fi if [ -f "/config/extended/logs/downloaded/notfound/$lidarrAlbumForeignAlbumId" ]; then log "$processNumber of $wantedListAlbumTotal :: $lidarrAlbumTitle :: $lidarrAlbumType :: Previously Not Found, skipping..." @@ -1050,17 +1063,7 @@ SearchProcess () { currentDate="$(date "+%F")" currentDateClean="$(echo "$currentDate" | sed -e "s%[^[:digit:]]%%g")" - if [ "$enableVideoScript" == "true" ]; then - if [ -d /config/extended/logs/video/complete ]; then - if [ -f "/config/extended/logs/video/complete/$lidarrArtistForeignArtistId" ]; then - log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Skipping until all videos are processed for the artist..." - continue - fi - else - log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Skipping until all videos are processed for the artist..." - continue - fi - fi + if [[ ${currentDateClean} -gt ${lidarrAlbumReleaseDateClean} ]]; then log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Starting Search..."