From d942be03b863679e7bf57ec118427ccf980b0caf Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 15 Aug 2022 16:36:48 -0400 Subject: [PATCH] v1.0.031 - Bug fix, correct order of operations to prevent error --- root/scripts/video.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/root/scripts/video.sh b/root/scripts/video.sh index aaf96b6..19f69d8 100644 --- a/root/scripts/video.sh +++ b/root/scripts/video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.030" +scriptVersion="1.0.031" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -212,12 +212,19 @@ TidaldlStatusCheck () { } ImvdbCache () { - if [ -z "$artistImvdbSlug" ]; then return fi + if [ ! -d "/config/extended/cache/imvdb" ]; then + log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: Creating Cache Folder..." + mkdir -p "/config/extended/cache/imvdb" + chmod 777 "/config/extended/cache/imvdb" + chown abc:abc "/config/extended/cache/imvdb" + fi + log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: Caching Records..." + if [ ! -f /config/extended/cache/imvdb/$artistImvdbSlug ]; then log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: Recording Artist Slug into cache" echo -n "$lidarrArtistName" > /config/extended/cache/imvdb/$artistImvdbSlug @@ -232,12 +239,7 @@ ImvdbCache () { imvdbVideoData="/config/extended/cache/imvdb/$lidarrArtistMusicbrainzId--$imvdbVideoUrlSlug.json" find /config/extended/cache/imvdb -type f -iname "*--[0-9]*[0-9].json" -delete #echo "$imvdbVideoUrl :: $imvdbVideoUrlSlug :: $imvdbVideoId" - if [ ! -d "/config/extended/cache/imvdb" ]; then - log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: Creating Cache Folder..." - mkdir -p "/config/extended/cache/imvdb" - chmod 777 "/config/extended/cache/imvdb" - chown abc:abc "/config/extended/cache/imvdb" - fi + log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: $imvdbProcessCount of $artistImvdbVideoUrlsCount :: Caching video data..." if [ -f "$imvdbVideoData" ]; then if [ ! -s "$imvdbVideoData" ]; then