Posts: 74
Joined: Jan 2017
Reputation:
0
2021-05-03, 21:52
(This post was last modified: 2021-05-03, 23:09 by DarrenHill.)
I have been trying to get the PINSENTRY Parental control app compatible with Kodi 19. I am currently stuck with this strange message which i am unable to resolve. Any help will be much appreciated.
def getNumberOfLevels():
return int(ADDON.getSetting("numberOfLevels")) + 1
return int(ADDON.getSetting("numberOfLevels")) + 1
ValueError: invalid literal for int() with base 10: ''
The reference to this in settings.xml as below.
<setting id="numberOfLevels" label="32020" type="enum" values="1|2|3|4|5" default="0" />
PINSENTRY link
Regards
Enigmaa
mod edit - link removed
Posts: 12,509
Joined: Oct 2014
Reputation:
608
Due to certain historic actions on his part, the author of that addon is banned from here, as are links to his repository.
The link above has been removed.
Posts: 1,722
Joined: Oct 2015
Reputation:
188
The error message is stating that Python cannot convert ADDON.getSetting("numberOfLevels") to an integer. There are a few possibilities for this but without seeing more code it is difficult to determine. I'd do this to debug it:
def getNumberOfLevels():
settingvalue = ADDON.getSetting("numberOfLevels")
xbmc.log('The setting value is: ' + str(settingvalue), xbmc.LOGINFO)
return int(ADDON.getSetting("numberOfLevels")) + 1
This will tell you what is being returned by ADDON.getSetting("numberOfLevels").
I am happy to help you finish the Kodi 19 conversion.
Jeff
Posts: 12,509
Joined: Oct 2014
Reputation:
608
Unfortunately he did - including stuff hidden within some addons which was definitely not welcome or acceptable.
To my knowledge, there is no work on any kind of fork of PinSentry or anything along the same lines.
Posts: 1,722
Joined: Oct 2015
Reputation:
188
Here's an example from my addon where I changed it between Kodi 18 and 19. Maybe this will help.
Kodi 18
li = xbmcgui.ListItem('Refresh', iconImage=addon.getAddonInfo("path") + '/resources/media/refresh.png')
Kodi 19
li = xbmcgui.ListItem('Refresh')
li.setArt({'icon':addon.getAddonInfo("path") + '/resources/media/refresh.png'})
Note there are multiple types of setArt art values. You are using thumbnail which is now thumb. You can also set multiple values like this as a dictionary:
li.setArt({'thumb': iconurl, 'poster': iconurl, 'icon': iconurl, 'fanart': addon.getAddonInfo("path") + 'fanart.jpg'})
Jeff