File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,27 @@ getSections() {
20
20
echo $sections
21
21
}
22
22
23
+ isRefreshing () {
24
+ refreshing=$( curl -s -G -L " ${plex_url} /library/sections?X-Plex-Token=${plex_token} " | grep ' refreshing="1"' )
25
+
26
+ echo $refreshing
27
+ }
28
+
23
29
emptyTrash () {
24
30
. " /usr/bin/check"
25
31
26
32
if [ " $all_good " -eq " 1" ]; then
27
33
echo " Refreshing library"
28
34
curl -s -G -L " ${plex_url} /library/sections/all/refresh?X-Plex-Token=${plex_token} "
29
- sleep 60
35
+
36
+ echo " [ $( date ${date_format} ) ] Library refreshing"
37
+ while true ; do
38
+ sleep 10
39
+ if [[ -z $( isRefreshing) ]]; then
40
+ break
41
+ fi
42
+ done
43
+ echo " [ $( date ${date_format} ) ] Library refresh completed"
30
44
31
45
sections=$( getSections)
32
46
if [ -z " ${sections} " ]; then
You can’t perform that action at this time.
0 commit comments