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-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
}