From 06d5b324c9202c6076613b89053a95b8b760788b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 22 Feb 2024 08:37:29 -0500 Subject: [PATCH] test --- plex-analyze.sh | 3 ++- plex-cleanbundles.sh | 3 ++- plex-freshen.sh | 9 ++++++--- plex-refreshmetadata.sh | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plex-analyze.sh b/plex-analyze.sh index 78d9cc3..cba7feb 100644 --- a/plex-analyze.sh +++ b/plex-analyze.sh @@ -23,7 +23,8 @@ update_from_api() { do echo "Analyzing for key: ${library_number}" - curl -X GET http://127.0.0.1:32400/library/sections/${library_number}/analyze\?X-Plex-Token=${LOCAL_PLEX_TOKEN} + plex_api_url="http://127.0.0.1:32400/library/sections/${library_number}/analyze\?X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url done diff --git a/plex-cleanbundles.sh b/plex-cleanbundles.sh index 79452be..da429e2 100644 --- a/plex-cleanbundles.sh +++ b/plex-cleanbundles.sh @@ -17,7 +17,8 @@ update_from_api() { # get plex token source ./plex-token.sh echo "Cleaning Bundles" - curl -X PUT http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN} + plex_api_url="http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url } case "$2" in diff --git a/plex-freshen.sh b/plex-freshen.sh index 979a701..c9092be 100644 --- a/plex-freshen.sh +++ b/plex-freshen.sh @@ -23,15 +23,18 @@ update_from_api() { 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} + plex_api_url="http://127.0.0.1:32400/library/sections/${library_number}/refresh\?force=1\&X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url 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} + plex_api_url="http://127.0.0.1:32400/library/sections/${library_number}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url done echo "Cleaning Bundles" - curl -X GET http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN} + plex_api_url="http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url } diff --git a/plex-refreshmetadata.sh b/plex-refreshmetadata.sh index 04f6231..39cc694 100644 --- a/plex-refreshmetadata.sh +++ b/plex-refreshmetadata.sh @@ -23,7 +23,8 @@ update_from_api() { 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} + plex_api_url="http://127.0.0.1:32400/library/sections/${library_number}/refresh\?force=1\&X-Plex-Token=${LOCAL_PLEX_TOKEN}" + curl -X GET $plex_api_url done }