From 1e0604eab7dbce1301bff0ae8e68fb9adf23f89e Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 26 Sep 2022 15:54:41 -0400 Subject: [PATCH] v1.0.001 - Only locate cookies.txt one time... --- root/scripts/AutoExtras.bash | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/root/scripts/AutoExtras.bash b/root/scripts/AutoExtras.bash index b7f707e..5f22a30 100644 --- a/root/scripts/AutoExtras.bash +++ b/root/scripts/AutoExtras.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.000" +scriptVersion="1.0.001" if [ -z "$arrUrl" ] || [ -z "$arrApiKey" ]; then arrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -26,6 +26,15 @@ fi exec &>> "/config/logs/AutoExtras.txt" chmod 666 "/config/logs/AutoExtras.txt" + +if find /config -type f -iname "cookies.txt" | read; then + cookiesFile="$(find /config -type f -iname "cookies.txt" | head -n1)" + log "Cookies File Found!" +else + log "Cookies File Not Found!" + cookiesFile="" +fi + radarrMovieList=$(curl -s --header "X-Api-Key:"${arrApiKey} --request GET "$arrUrl/api/v3/movie") radarrMovieTotal=$(echo "${radarrMovieList}" | jq -r '.[] | select(.hasFile==true) | .id' | wc -l) radarrMovieIds=$(echo "${radarrMovieList}" | jq -r '.[] | select(.hasFile==true) | .id') @@ -34,7 +43,7 @@ loopCount=0 for id in $(echo $radarrMovieIds); do loopCount=$(( $loopCount + 1 )) log "$loopCount of $radarrMovieTotal :: $id :: Processing with MovieExtras.bash" - bash /config/extended/scripts/MovieExtras.bash "$id" + bash /config/extended/scripts/MovieExtras.bash "$id" "$cookiesFile" done exit