test
This commit is contained in:
parent
9f08b6729c
commit
df36dd1171
11
plex-library-ids.sh
Normal file
11
plex-library-ids.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
token_from_api() {
|
||||||
|
source ./plex-token.sh
|
||||||
|
LOCAL_LIBRARY_IDS= $(`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)"'`)
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$2" in
|
||||||
|
""|silent) token_from_Pref_XML;;
|
||||||
|
*) echo "'$2' is not a valid plex-tools library id command";;
|
||||||
|
esac
|
||||||
@ -15,10 +15,11 @@ update_from_cli() {
|
|||||||
|
|
||||||
update_from_api() {
|
update_from_api() {
|
||||||
# get plex token
|
# get plex token
|
||||||
source ./plex-token.sh
|
#source ./plex-token.sh
|
||||||
|
source ./plex-library-ids.sh
|
||||||
|
|
||||||
# run a loop against each library
|
# 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
|
do
|
||||||
echo "Running Library Update and metadata refresh for key: ${library_number}"
|
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}
|
||||||
@ -32,9 +33,3 @@ case "$2" in
|
|||||||
""|api) update_from_api;;
|
""|api) update_from_api;;
|
||||||
*) echo "'$2' is not a valid plex-tools freshen command";;
|
*) echo "'$2' is not a valid plex-tools freshen command";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
# clean PhotoTranscoder Cache
|
|
||||||
#echo "Deleting PhotoTranscoder Cache"
|
|
||||||
#CACHEPATH="$AppSuppDir/Plex Media Server/Cache/PhotoTranscoder"
|
|
||||||
#find "${CACHEPATH}" -type f -delete
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user