From 836c01f3972f3e04f0b0e43ed6c59bd835c1348d Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 14 Jun 2022 20:21:45 -0400 Subject: [PATCH] Bug fix, actaully works.... --- root/scripts/PlexNotify.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/root/scripts/PlexNotify.bash b/root/scripts/PlexNotify.bash index bce68c6..7189d09 100644 --- a/root/scripts/PlexNotify.bash +++ b/root/scripts/PlexNotify.bash @@ -2,7 +2,7 @@ lidarrApiKey="$(grep "" /config/config.xml | sed "s/\ //;s/<\/ApiKey>//")" lidarrUrl="http://127.0.0.1:8686" lidarrRootFolderPath="$(dirname "$lidarr_artist_path")" -exec &>> "/config/logs/PlexNotify.txt" +#exec &>> "/config/logs/PlexNotify.txt" chmod 777 "/config/logs/PlexNotify.txt" log () { @@ -17,7 +17,7 @@ fi plexLibraries="$(curl -s "$plexUrl/library/sections?X-Plex-Token=$plexToken" | xq .)" if echo "$plexLibraries" | grep "$lidarrRootFolderPath" | read; then - if echo "$plexLibraries" | jq -r ".MediaContainer.Directory[] | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" | head -n 1 &>/dev/null; then + if echo "$plexLibraries" | jq -r ".MediaContainer.Directory[] | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" &>/dev/null; then plexlibrarykey="$(echo "$plexLibraries" | jq -r ".MediaContainer.Directory[] | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" | head -n 1)" else plexlibrarykey="$(echo "$plexLibraries" | jq -r ".MediaContainer.Directory | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" | head -n 1)" @@ -32,8 +32,8 @@ else exit 1 fi -plexFolderEncoded="$(jq -R -r @uri <<<"$Lidarr_Artist_Path")" +plexFolderEncoded="$(jq -R -r @uri <<<"$lidarr_artist_path")" curl -s "$plexUrl/library/sections/$plexlibrarykey/refresh?path=$plexFolderEncoded&X-Plex-Token=$plexToken" -log "Plex Scan notification sent! ($Lidarr_Artist_Path)" +log "Plex Scan notification sent! ($lidarr_artist_path)" exit 0