From e79d7c2730fd59d97fa65f78971fae2a62566567 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 22 Feb 2024 08:25:24 -0500 Subject: [PATCH] test --- plex-emptytrash.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/plex-emptytrash.sh b/plex-emptytrash.sh index bad4a30..fb18115 100644 --- a/plex-emptytrash.sh +++ b/plex-emptytrash.sh @@ -18,21 +18,16 @@ update_from_api() { #source ./plex-token.sh source ./plex-library-ids.sh - array=$LOCAL_LIBRARIES_IDS - array2=$LOCAL_LIBRARIES_TITLES - # run a loop against each library - echo "Emptying Trash for all libraries" - - for index in ${!array[*]} + i=0 + for library_id in $LOCAL_LIBRARIES_IDS do - library_id=${array[$index]} - #"${LOCAL_LIBRARIES_IDS[index]}" - library_title="${array2[index]}" + library_title=$LOCAL_LIBRARIES_TITLES[$i] - echo "Emptying Trash for Library: ${library_id} ${library_title}" + echo "Emptying Trash for ${library_title} ${library_id}" curl -X GET http://127.0.0.1:32400/library/sections/${library_id}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN} + i=$(( $i + 1)); done }