handle error when ListItem is not a folder
#1
Ok, the title is kind of confusing I'll grant you, but here's what's happening. I'm using a state machine type set up (I've been looking at the iplayer add on) and when adding a list item as a folder I can quite happily use

Code:
__plugin_handle__ = int(sys.argv[1])
host = xbmcplugin.getSetting(__plugin_handle__, 'host')


and it will return the correct host setting. Add a list item with folder = False and I get 'GetSetting called with an invalid handle.' in the logs. So basically, click on a folder and the plugin handle is found correctly, click on a non folder and it's not.

This is my first add on so be gentle!
Reply
#2
Not sure this will help, but this is usually how I go about it, from my archive add-on.
Code:
__settings__ = xbmcaddon.Addon(id='plugin.audio.internet.archive')
sort = __settings__.getSetting('sort_by')
Reply
#3
Cheers, that did it!
Reply
#4
locellcount Wrote:Cheers, that did it!
You can even more shorten it to:
Code:
__settings__ = xbmcaddon.Addon()

It will get it's id automaticly
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply

Logout Mark Read Team Forum Stats Members Help
handle error when ListItem is not a folder0