2017-01-24, 23:31
(2017-01-24, 06:13)oattes Wrote: Things are back to the 'occasional' miss. You mentioned that you had put a little delay in the widget refresh. If you let me know where that is implemented, perhaps I can play with it a little bit to see if I can find out the behaviour of the race condition -- which is, I am guessing, between your 'monitor' code and the time when the widget is refreshed, with the latter needing to be *after* the former completes.
The widget refresh is triggered by the kodimonitor code so it can either be one of these causes:
1) the event is not fired that there was a change in db or media stopped
2) when the event is fired, the db has not yet saved the new value
The code is now changed so it refreshes in any of these conditions:
- media playback stopped
- item changed in db (e.g. watchstate toggled)
- kodi db updated (e.g. library scan)
Are you sure you updated to the latest bits ? script.skin.helper.widgets should be at version 1.0.17
If you want to test with another delay (but that shouldn't be needed as the event is fired twice in a row):
script.skin.helper.widgets --> kodi_monitor.py --> add a delay after line 68:
xbmc.sleep(1000) for example sets a 1 second delay.