Vinny, I pushed some small updates to the movreel resolver
For the settings - this is a tip for everyone creating resolvers, make sure they are preceded by the name of the resolver class to simplify your code and eliminate the need to import xbmcaddon
eg.
This is the typical start to a new resolver, I put the name in RED:
Further down when you do your settings, name them as so, note the setting id naming convention:
Then in your code, you just need to do this to grab a setting, no need to import in xbmcaddon as it's already available via urlresolvers PluginSettings which you have imported
Note how I don't use the preceding 'MovreelResolver_' portion:
Some have done this for their settings so that you don't need to worry about the convention:
For the settings - this is a tip for everyone creating resolvers, make sure they are preceded by the name of the resolver class to simplify your code and eliminate the need to import xbmcaddon
eg.
This is the typical start to a new resolver, I put the name in RED:
Code:
class [COLOR="#FF0000"]MovreelResolver[/COLOR](Plugin, UrlResolver, SiteAuth, PluginSettings):
implements = [UrlResolver, SiteAuth, PluginSettings]
name = "movreel"
profile_path = common.profile_path
cookie_file = os.path.join(profile_path, '%s.cookies' % name)
Code:
#Obtaining the Movreel login info from your app
def get_settings_xml(self):
xml = PluginSettings.get_settings_xml(self)
xml += '<setting id="[COLOR="#FF0000"]MovreelResolver[/COLOR]_login" '
xml += 'type="bool" label="login" default="false"/>\n'
xml += '<setting id="[COLOR="#FF0000"]MovreelResolver[/COLOR]_username" enable="eq(-1,true)" '
xml += 'type="text" label="username" default=""/>\n'
xml += '<setting id="[COLOR="#FF0000"]MovreelResolver[/COLOR]_password" enable="eq(-2,true)" '
xml += 'type="text" label="password" option="hidden" default=""/>\n'
return xml
Note how I don't use the preceding 'MovreelResolver_' portion:
Code:
login = self.get_setting('login')
Some have done this for their settings so that you don't need to worry about the convention:
Code:
#PluginSettings methods
def get_settings_xml(self):
xml = PluginSettings.get_settings_xml(self)
xml += '<setting label="Highest Quality" id="[COLOR="#FF0000"]%s[/COLOR]_quality" ' % [COLOR="#FF0000"]self.__class__.__name__[/COLOR]
xml += 'type="enum" values="FLV|Maximum" default="0" />\n'
xml += '<setting id="%s_login" ' % self.__class__.__name__
xml += 'type="bool" label="login" default="false"/>\n'
xml += '<setting id="%s_username" enable="eq(-1,true)" ' % self.__class__.__name__
xml += 'type="text" label="username" default=""/>\n'
xml += '<setting id="%s_password" enable="eq(-2,true)" ' % self.__class__.__name__
xml += 'type="text" label="password" option="hidden" default=""/>\n'
xml += '<setting id="%s_notify" ' % self.__class__.__name__
xml += 'type="bool" label="Notify on login" default="false"/>\n'
return xml