2020-01-05, 00:35
(2020-01-04, 22:19)scott967 Wrote: I also see the ERROR: EXCEPTION: Invalid setting type but I don't see anything wrong in settings.xml. TBH I don't understand what Kodi debug log is logging when addon settings are used (there's the old settings and new settings and they've been a moving target).
I have a wrapper for the xbmcadd.Addon().getSetting stuff (i.e. getSettingInt, etc) so that I can use the same call in older versions of Kodi and newer ones. Apparently if you use getSettingInt to get a setting that doesn't exist (and there's a particular case in my code where that is true, it's a long reason), Python throws a Type Error. In the wrapper I trap for that error and then return a default value, but Kodi logs that Invalid Type anyway. If you use the older getSetting, it returns an empty string if the setting isn't found and no error is logged. I rewrote the wrapper to stop using getSettingInt and instead just try and force getSetting into an int (which is what I was doing for older Kodi versions anyway). If the int conversion fails it generates a python Value Error. Since I trap for that and return the default value, Kodi doesn't log anything about any errors.
So basically the solution is to stop using the newer getSettingInt, getSettingNumber, or getSettingBool so you get fewer log entries with errors. '-)