[Dev] Issue: Async updaing metadata of loaded UI
#1
Hi All,
I tring to access the current list after the listed has been load to the screen. I get a message saying the windowid is "10025" but the list size is always zero. What is the windowid of the generic video addon plugin? (The window we are using for addDirectoryItem)

The reason i want access to the current window list is to async update metadata on the background thread without blocking/slowing the UI thread during the call to the imdbapi.com after the list paints to the screen.

BTW: I tring this on the latest released windows version (10.0.0.0 3 Mar 2011) (not the nightly)

Thanks,
slyi

eg:
PHP Code:
wid xbmcgui.getCurrentWindowId()
wnd xbmcgui.Window(wid)
ctrl wnd.getControl(wnd.getFocusId())
if 
debug==1:
         
xbmc.executebuiltin("XBMC.Notification(DebugMsg, Ctrl: "str(ctrl) +")")
#currItem = ctrl.getSelectedItem()
#currItem.setLabel('async updating listitem value')
if debug==1:
         
xbmc.executebuiltin("XBMC.Notification(DebugMsg, Size: "str(ctrl.size()) +")")
ctrl.addItem(xbmcgui.ListItem('Adding a new enables a completely different window/list?????))
if debug==1:
         xbmc.executebuiltin("XBMC.Notification(DebugMsg, Size: "+ str(ctrl.size()) +")") 
Reply
#2
For anyone interested i got working using the code below
PHP Code:
items =['..']
wid xbmcgui.getCurrentWindowId()    
wnd xbmcgui.Window(wid)
ctrl wnd.getControl(wnd.getFocusId())

li=xbmcgui.ListItem("Movie 1")
u=localpath+"?url=1"
xbmcplugin.addDirectoryItem(handle,u,li,True)
items.append(li)
    
li=xbmcgui.ListItem("Movie 2")
u=localpath+"?url=2"
xbmcplugin.addDirectoryItem(handle,u,li,True)
items.append(li)

ctrl.addItems(items)         
xbmcplugin.endOfDirectory(handle,succeeded=TruecacheToDisc=False)
xbmc.executebuiltin("XBMC.Notification(DebugMsg, Old Label:"str(ctrl.getListItem(1).getLabel()) +")")
ctrl.getListItem(1).setLabel('async'
Reply
#3
I got demo working on http://dl.dropbox.com/u/6589941/asyncmet...ncmeta.zip

http://dl.dropbox.com/u/6589941/asyncmeta/addon.py.txt

This uses json rather than sql for storage and uses imdbapi.com for meta.
Only tested on nightly win7 so far.
Reply

Logout Mark Read Team Forum Stats Members Help
[Dev] Issue: Async updaing metadata of loaded UI0