diff --git a/plex-analyze.sh b/plex-analyze.sh index d4233a9..78d9cc3 100644 --- a/plex-analyze.sh +++ b/plex-analyze.sh @@ -19,7 +19,7 @@ update_from_api() { source ./plex-library-ids.sh # run a loop against each library - for library_number in $LOCAL_LIBRARIES_IDS + for library_number in $LOCAL_LIBRARY_IDS do echo "Analyzing for key: ${library_number}" diff --git a/plex-emptytrash.sh b/plex-emptytrash.sh index ef5f3cd..dfb5598 100644 --- a/plex-emptytrash.sh +++ b/plex-emptytrash.sh @@ -19,11 +19,11 @@ update_from_api() { source ./plex-library-ids.sh # run a loop against each library - for library_id in $LOCAL_LIBRARIES_IDS + for library_number in $LOCAL_LIBRARY_IDS do - echo "Emptying Trash for ${library_id}" - curl -X GET http://127.0.0.1:32400/library/sections/${library_id}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN} + echo "Emptying Trash for key: ${library_number}" + curl -X GET http://127.0.0.1:32400/library/sections/${library_number}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN} done diff --git a/plex-freshen.sh b/plex-freshen.sh index 9c613ee..979a701 100644 --- a/plex-freshen.sh +++ b/plex-freshen.sh @@ -19,7 +19,7 @@ update_from_api() { source ./plex-library-ids.sh # run a loop against each library - for library_number in $LOCAL_LIBRARIES_IDS + for library_number in $LOCAL_LIBRARY_IDS do echo "Running Library Update and metadata refresh for key: ${library_number}" diff --git a/plex-library-ids.sh b/plex-library-ids.sh index 86aea1e..d7a4bb1 100644 --- a/plex-library-ids.sh +++ b/plex-library-ids.sh @@ -3,8 +3,7 @@ ids_from_api() { source ./plex-token.sh echo "Getting Plex Library list" - LOCAL_LIBRARIES_IDS=`curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.key)"'` - LOCAL_LIBRARIES_TITLES=`curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.title)"'` + LOCAL_LIBRARY_IDS=`curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.key)"'` } case "$2" in diff --git a/plex-refreshmetadata.sh b/plex-refreshmetadata.sh index 663d64c..04f6231 100644 --- a/plex-refreshmetadata.sh +++ b/plex-refreshmetadata.sh @@ -20,7 +20,7 @@ update_from_api() { source ./plex-library-ids.sh # run a loop against each library - for library_number in $LOCAL_LIBRARIES_IDS + for library_number in $LOCAL_LIBRARY_IDS do echo "Running Library Update and metadata refresh for key: ${library_number}" curl -X GET http://127.0.0.1:32400/library/sections/${library_number}/refresh\?force=1\&X-Plex-Token=${LOCAL_PLEX_TOKEN}