I have a directory list containing some custom info (download progress) that I want to update every few seconds. So I started a thread update the directory list, sleep for a few seconds, and repeat.
Code:
while True:
label = getDownloadProgress() # Eg: 52%
item = xbmcgui.ListItem(label = label)
xbmcplugin.addDirectoryItem(handle = addonHandle, url = url, listitem = item, isFolder = False)
xbmcplugin.endOfDirectory(addonHandle, cacheToDisc = False, updateListing = True)
time.sleep(5)
However, the progress is ONLY updated during the first run of the loop. Every consecutive updates are not shown in the interface. I’ve also tried adding
Code:
xbmc.executebuiltin('Container.Update')
after endOfDirectory, but that doesn’t change anything. When I add
Code:
xbmc.executebuiltin('Container.Refresh')
Kodi goes berserk, and just keeps loading, eventually freezing and then crashing.
Any suggestions on why the directory is not updated with the new value?