Open daveftw84 opened 2 years ago
I think that's here, I don't know if it works within the skin though.
sadly that doesnt work
If I can read this right:
def refresh_video_widgets(self, media_type):
'''refresh video widgets'''
log_msg("Video database changed - type: %s - refreshing widgets...." % media_type)
timestr = time.strftime("%Y%m%d%H%M%S", time.gmtime())
self.win.setProperty("widgetreload", timestr)
if media_type:
self.win.setProperty("widgetreload-%ss" % media_type, timestr)
if "episode" in media_type:
self.win.setProperty("widgetreload-tvshows", timestr)
def onNotification(self, sender, method, data):
'''builtin function for the xbmc.Monitor class'''
try:
log_msg("Kodi_Monitor: sender %s - method: %s - data: %s" % (sender, method, data))
if sys.version_info.major == 3:
data = json.loads(data)
else:
data = json.loads(data.decode('utf-8'))
mediatype = ""
if data and isinstance(data, dict):
if data.get("item"):
mediatype = data["item"].get("type", "")
elif data.get("type"):
mediatype = data["type"]
if method == "VideoLibrary.OnUpdate":
if not mediatype:
mediatype = self.last_mediatype # temp hack
self.refresh_video_widgets(mediatype)
if method == "AudioLibrary.OnUpdate":
self.refresh_music_widgets(mediatype)
if method == "Player.OnStop":
self.last_mediatype = mediatype
if mediatype in ["movie", "episode", "musicvideo"]:
if self.addon.getSetting("aggresive_refresh") == "true":
self.refresh_video_widgets(mediatype)
except Exception as exc:
log_msg("Exception in KodiMonitor: %s" % exc, xbmc.LOGERROR)
Looks like it doesn't require skin implementation, it should just work. I wonder what your logs say, could be that there's just no change so no need to aggressively update.
aggressive widget reloading