(2015-07-28, 03:50)Milhouse Wrote: The only way to monitor scan progress is to process the JSON RPC library notifications (in the case of scanning: OnScanStarted, OnUpdate, OnScanFinished), or query the infobooleans relating to library scan status.
In your case you need to wait for the "OnScanFinished" notification, or continually poll the "Library.IsScanningMusic" and "Library.IsScanningVideo" infobooleans.
FYI, this is my first experience working with Kodi's API, or for that matter, my first experience with JSON... so apologies if my questions don't make sense.
I understand the notion of using OnScanStarted, OnUpdate or OnScanFinished. I just can't understand why my request (in the post above) isn't working. Taking a punt, I'm assuming this is because it's a notification request, which needs to run through TCP... whereas my curl command is running over HTTP.
Thanks for pointing me to the infobooleans, because that's given me what I was searching for...
curl -u xbmc:xbmc -H "Content-Type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params": { "booleans": ["library.isscanning"]} ,"id":1}'
http://openelec.local/jsonrpc
My plan was to basically keep polling Kodi until I got a "false" response... and the query above gives me what I was after.