plex-tools/plex-cleanbundles.sh
deathbybandaid a0d56c6ec0 test
2023-03-15 08:23:22 -04:00

34 lines
806 B
Bash

#!/bin/sh
update_from_cli() {
# ChuckPa already wrote a great function for getting host info
source ./HostConfig.sh
echo "Getting Host Information"
HostConfig
plex_scanner_location="$PKGDIR/Plex Media Scanner"
echo "Getting Plex Library list"
echo $("$plex_scanner_location" --list)
exit
}
update_from_api() {
# get plex token
source ./plex-token.sh
echo "Cleaning Bundles"
curl -X PUT http://127.0.0.1:32400/library/clean/bundles?X-Plex-Token=${LOCAL_PLEX_TOKEN}
}
case "$2" in
cli) update_from_cli;;
""|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