This commit is contained in:
deathbybandaid 2024-02-22 08:25:24 -05:00
parent 84d37a3b5a
commit e79d7c2730

View File

@ -18,21 +18,16 @@ update_from_api() {
#source ./plex-token.sh #source ./plex-token.sh
source ./plex-library-ids.sh source ./plex-library-ids.sh
array=$LOCAL_LIBRARIES_IDS
array2=$LOCAL_LIBRARIES_TITLES
# run a loop against each library # run a loop against each library
echo "Emptying Trash for all libraries" i=0
for library_id in $LOCAL_LIBRARIES_IDS
for index in ${!array[*]}
do do
library_id=${array[$index]} library_title=$LOCAL_LIBRARIES_TITLES[$i]
#"${LOCAL_LIBRARIES_IDS[index]}"
library_title="${array2[index]}"
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} curl -X GET http://127.0.0.1:32400/library/sections/${library_id}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN}
i=$(( $i + 1));
done done
} }