howto detect if updatelibrary is done?
#1
Is there anyway to detect if a updatelibrary is done ? I have just done a simple autoexec.py script where it start scanning a specific path for new series, and now I also want it to scan for movies. The problem I am having is that using 2 updatelibraries in a row breaks the scan completely, so I need a way to detect if the first scan is done before executing the next one. Is there a way to do this ? if so, how?

And fyi, dont tell me to do a complete library scan at startup, it takes to long time for me (30+ min).
Reply
#2
Something like this might work (untested pseudo code) ..

Code:
while (xbmc.getCondVisibility('Library.IsScanningVideo')):
  xbmc.sleep(100)
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Thanks, but it didnt seem to work Sad, my code is as follows:

Code:
import os, xbmc, time

print "running autoexec.py"
time.sleep(5)
xbmc.executebuiltin("xbmc.updatelibrary(video,aaa)")
time.sleep(5)
while (xbmc.getCondVisibility("Library.IsScanningVideo")) : xbmc.sleep(10)
xbmc.executebuiltin("Notification(Testing,XBMC Command Success.)")
print "finished autoexec.py"

What happens is that the library is scanning and after 10 seconds the notification is still popping up, while library is still scanning.
Reply
#4
What revision/build of XBMC you're running. The infolabel Library.IsScanningVideo is a pretty new one.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
I found the solution!

Code:
while (xbmc.getCondVisibility('Window.IsActive(videoscan)')) : xbmc.sleep(10)

Thanks vdrfan for the hint on getCondVisibility Smile
Reply
#6
vdrfan Wrote:What revision/build of XBMC you're running. The infolabel Library.IsScanningVideo is a pretty new one.

I am on 10.1
Reply
#7
Glad to hear it's working now Wink
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply

Logout Mark Read Team Forum Stats Members Help
howto detect if updatelibrary is done?0