From c2019660b38e0ad0f5f8fce247f3e0fc2ae9a311 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 26 Sep 2022 15:58:56 -0400 Subject: [PATCH] v1.0.014 - Skip search for cookies.txt, when called by auto script --- root/scripts/MovieExtras.bash | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/root/scripts/MovieExtras.bash b/root/scripts/MovieExtras.bash index 291d187..eb00a3f 100644 --- a/root/scripts/MovieExtras.bash +++ b/root/scripts/MovieExtras.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.013" +scriptVersion="1.0.014" arrEventType="$radarr_eventtype" arrItemId=$radarr_movie_id tmdbApiKey="3b7751e3179f796565d88fdb2fcdf426" @@ -9,6 +9,8 @@ updatePlex="false" if [ ! -z "$1" ]; then arrItemId="$1" autoScan="true" +else + autoScan="false" fi # Debugging @@ -56,12 +58,20 @@ if [ "$enableExtras" != "true" ]; then exit fi -if find /config -type f -name "cookies.txt" | read; then - cookiesFile="$(find /config -type f -iname "cookies.txt" | head -n1)" - log "Cookies File Found!" +if [ "$autoScan" == "true" ]; then + if [ ! -z "$2" ]; then + cookiesFile="$2" + else + cookiesFile="" + fi else - log "Cookies File Not Found!" - cookiesFile="" + 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 fi arrItemData=$(curl -s "$arrUrl/api/v3/movie/$arrItemId?apikey=$arrApiKey")