This commit is contained in:
deathbybandaid 2024-02-22 07:54:23 -05:00
parent c073cb6082
commit c0a4d3e208
4 changed files with 14 additions and 20 deletions

View File

@ -15,10 +15,11 @@ update_from_cli() {
update_from_api() {
# get plex token
source ./plex-token.sh
#source ./plex-token.sh
source ./plex-library-ids.sh
# run a loop against each library
for library_number in `curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.key)"'`
for library_number in $LOCAL_LIBRARY_IDS
do
echo "Analyzing for key: ${library_number}"
@ -33,9 +34,3 @@ case "$2" in
""|api) update_from_api;;
*) echo "'$2' is not a valid plex-tools freshen command";;
esac
# clean PhotoTranscoder Cache
#echo "Deleting PhotoTranscoder Cache"
#CACHEPATH="$AppSuppDir/Plex Media Server/Cache/PhotoTranscoder"
#find "${CACHEPATH}" -type f -delete

View File

@ -15,10 +15,11 @@ update_from_cli() {
update_from_api() {
# get plex token
source ./plex-token.sh
#source ./plex-token.sh
source ./plex-library-ids.sh
# run a loop against each library
for library_number in `curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.key)"'`
for library_number in $LOCAL_LIBRARY_IDS
do
echo "Emptying Trash for key: ${library_number}"
@ -33,9 +34,3 @@ case "$2" in
""|api) update_from_api;;
*) echo "'$2' is not a valid plex-tools freshen command";;
esac
# clean PhotoTranscoder Cache
#echo "Deleting PhotoTranscoder Cache"
#CACHEPATH="$AppSuppDir/Plex Media Server/Cache/PhotoTranscoder"
#find "${CACHEPATH}" -type f -delete

View File

@ -15,10 +15,11 @@ update_from_cli() {
update_from_api() {
# get plex token
source ./plex-token.sh
#source ./plex-token.sh
source ./plex-library-ids.sh
# run a loop against each library
for library_number in `curl -s -H "Accept: application/json" -H "X-Plex-Token: ${LOCAL_PLEX_TOKEN}" http://127.0.0.1:32400/library/sections | jq -M -r '.MediaContainer.Directory[] | "\(.key)"'`
for library_number in $LOCAL_LIBRARY_IDS
do
echo "Running Library Update and metadata refresh for key: ${library_number}"
@ -28,8 +29,10 @@ update_from_api() {
curl -X PUT http://127.0.0.1:32400/library/sections/${library_number}/emptyTrash\?X-Plex-Token=${LOCAL_PLEX_TOKEN}
done
echo "Cleaning Bundles"
curl -X PUT http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN}
}
case "$2" in

View File

@ -1,5 +1,6 @@
#!/bin/sh
update_from_cli() {
# ChuckPa already wrote a great function for getting host info
source ./HostConfig.sh
@ -22,8 +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 PUT http://127.0.0.1:32400/library/sections/${library_number}/refresh\?force=1\&X-Plex-Token=${LOCAL_PLEX_TOKEN}
curl -X PUT "http://127.0.0.1:32400/library/sections/${library_number}/refresh?force=1&X-Plex-Token=${LOCAL_PLEX_TOKEN}"
curl -X GET http://127.0.0.1:32400/library/sections/${library_number}/refresh\?force=1\&X-Plex-Token=${LOCAL_PLEX_TOKEN}
#curl -X PUT "http://127.0.0.1:32400/library/sections/${library_number}/refresh?force=1&X-Plex-Token=${LOCAL_PLEX_TOKEN}"
done
}