From 7fd5ebb000aa3543f35bd2c22a1101657e91ad51 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Thu, 13 Jul 2023 17:38:49 -0400 Subject: [PATCH] v1.1 - Bug fix --- lidarr/MetadataPostProcess.bash | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lidarr/MetadataPostProcess.bash b/lidarr/MetadataPostProcess.bash index db3a4e1..2d55480 100644 --- a/lidarr/MetadataPostProcess.bash +++ b/lidarr/MetadataPostProcess.bash @@ -1,5 +1,5 @@ -#!/usr/bin/env bash -scriptVersion=1.0 +#!/usr/bin/with-contenv bash +scriptVersion=1.1 if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" == "null" ]; then @@ -40,17 +40,13 @@ getAlbumArtist="$(curl -s "$lidarrUrl/api/v1/album/$lidarr_album_id" -H "X-Api-K getAlbumArtistPath="$(curl -s "$lidarrUrl/api/v1/album/$lidarr_album_id" -H "X-Api-Key: ${lidarrApiKey}" | jq -r .artist.path)" getTrackPath="$(curl -s "$lidarrUrl/api/v1/trackFile?albumId=$lidarr_album_id" -H "X-Api-Key: ${lidarrApiKey}" | jq -r .[].path | head -n1)" getFolderPath="$(dirname "$getTrackPath")" -getAlbumFolderName="$(basename "$getFolderPath")" - -log "Processing :: $getAlbumFolderName :: Start" if echo "$getFolderPath" | grep "$getAlbumArtistPath" | read; then if [ ! -d "$getFolderPath" ]; then - log "Processing :: $getAlbumFolderName :: ERROR :: \"$getFolderPath\" Folder is missing :: Exiting..." - exit + log "ERROR :: \"$getFolderPath\" Folder is missing :: Exiting..." fi else - log "Processing :: $getAlbumFolderName :: ERROR :: $getAlbumArtistPath not found within \"$getFolderPath\" :: Exiting..." + log "ERROR :: $getAlbumArtistPath not found within \"$getFolderPath\" :: Exiting..." exit fi