2016-06-23, 01:51
Basically the issue i'm having is this;
Ive add a contextmenuitem to a directoryitem, when selected it uses xbmc.RunPlugin to call the plugin again but with parameters that will force a video download.
This was previously working fine, although I'm guessing the issue existed but didn't cause an error... the error that I'm currently getting is that the xbmc.RunPlugin has a handle of -1 and as such when I use xbmcplugin.getSetting it throws the WARNING: Attempt to use invalid handle -1
I've had a look online and have found some posts talking about it, but nothing that seems to resolve the problem, so would really appreciate a hand or a point to some more documentation that may come in handy resolving it.
Below, is what I'm using to get the content menu added'
Ive add a contextmenuitem to a directoryitem, when selected it uses xbmc.RunPlugin to call the plugin again but with parameters that will force a video download.
This was previously working fine, although I'm guessing the issue existed but didn't cause an error... the error that I'm currently getting is that the xbmc.RunPlugin has a handle of -1 and as such when I use xbmcplugin.getSetting it throws the WARNING: Attempt to use invalid handle -1
I've had a look online and have found some posts talking about it, but nothing that seems to resolve the problem, so would really appreciate a hand or a point to some more documentation that may come in handy resolving it.
Below, is what I'm using to get the content menu added'
Code:
u=sys.argv[0]+"?url="+detail['url']+"&mode="+str(detail['mode'])+"&name="+urllib.quote_plus(detail['title'].encode("utf-8"))+"&icon="+detail['icon']
liz=xbmcgui.ListItem(detail['title'].encode("utf-8"), iconImage=detail['icon'])
liz.setInfo(type=detail['type'], infoLabels={ "Title": detail['title'].encode("utf-8"),"Plot": detail['plot']} )
dwnld = (sys.argv[0] +
"?url=" + urllib.quote_plus(detail['url']) +
"&mode=" + str(9) +
"&poster="+detail['poster']+
"&extras="+detail['extras']+
"&download=" + str(1) +
"&fanart="+detail['fanart']+
"&name=" + urllib.quote_plus(detail['extras2'].encode('utf-8')))
liz.addContextMenuItems([('Save', 'xbmc.RunPlugin('+dwnld+')')], replaceItems=False)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)