Update PlexNotify.bash

pull/6/head
RandomNinjaAtk 2 years ago committed by GitHub
parent bc999b8302
commit 581f1272fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,7 +17,11 @@ fi
plexLibraries="$(curl -s "$plexUrl/library/sections?X-Plex-Token=$plexToken" | xq .)"
if echo "$plexLibraries" | grep "$lidarrRootFolderPath" | read; then
plexlibrarykey="$(echo "$plexLibraries" | jq -r ".MediaContainer.Directory[] | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" | head -n 1)"
if echo "$plexLibraries" | jq -r ".MediaContainer.Directory[] | select(.Location.\"@path\"==\"$lidarrRootFolderPath\") | .\"@key\"" | head -n 1 &>/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)"
fi
if [ -z "$plexlibrarykey" ]; then
log "ERROR: No Plex Library key found for \"$lidarrRootFolderPath\""
exit 1

Loading…
Cancel
Save