diff --git a/plex-emptytrash.sh b/plex-emptytrash.sh index ab2abab..bad4a30 100644 --- a/plex-emptytrash.sh +++ b/plex-emptytrash.sh @@ -23,17 +23,12 @@ update_from_api() { # run a loop against each library echo "Emptying Trash for all libraries" - i=0 - while [ $i -lt ${#array[*]} ]; do - echo ${array[$i]} is in ${array2[$i]} - i=$(( $i + 1)); - done - for index in ${!LOCAL_LIBRARIES_[*]} + for index in ${!array[*]} do - library_id=${LOCAL_LIBRARIES_IDS[$index]} + library_id=${array[$index]} #"${LOCAL_LIBRARIES_IDS[index]}" - library_title="${LOCAL_LIBRARIES_TITLES[index]}" + library_title="${array2[index]}" echo "Emptying Trash for Library: ${library_id} ${library_title}" curl -X GET http://127.0.0.1:32400/library/sections/${library_id}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN}