File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ getSections() {
11
11
echo $sections
12
12
}
13
13
14
+ isRefreshing () {
15
+ refreshing=$( curl -s -G -L " ${plex_url} /library/sections?X-Plex-Token=${plex_token} " | grep ' refreshing="1"' )
16
+
17
+ echo $refreshing
18
+ }
19
+
14
20
emptyTrash () {
15
21
bash mountcheck
16
22
@@ -22,7 +28,15 @@ emptyTrash() {
22
28
if mountpoint -q " $cloud_dir " && mountpoint -q " $cloud_decrypt_dir " && mountpoint -q " ${local_media_dir} " && [ " $( ls -A ${cloud_decrypt_dir} ) " ]; then
23
29
echo " Refreshing library"
24
30
curl -s -G -L " ${plex_url} /library/sections/all/refresh?X-Plex-Token=${plex_token} "
25
- sleep 60
31
+
32
+ echo " [ $( date ${date_format} ) ] Library refreshing"
33
+ while true ; do
34
+ sleep 10
35
+ if [[ -z $( isRefreshing) ]]; then
36
+ break
37
+ fi
38
+ done
39
+ echo " [ $( date ${date_format} ) ] Library refresh completed"
26
40
27
41
sections=$( getSections)
28
42
if [ -z " ${sections} " ]; then
You can’t perform that action at this time.
0 commit comments