2018-01-09, 11:06
(2018-01-08, 12:38)twilight0 Wrote: Ok I can give you the requested changes directly here, no problem...Just tested with getInfoLabel('System.ScreenWidth') and it DOESN'T center the image correctly, while with my code it does... ??
1) default.py & standalone.py, latest addon version, line 99+
change to something like this:Code:def _get_skin_resolution(self):
xmlFile = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")
xmldoc = minidom.parse(xmlFile)
res = xmldoc.getElementsByTagName("res")
xval = int(res[0].attributes["width"].value)
yval = int(res[0].attributes["height"].value)
return(xval, yval)
Code:def _get_skin_resolution(self):
xval = xbmc.getInfoLabel('System.ScreenWidth')
yval = xbmc.getInfoLabel('System.ScreenHeight')
return int(xval), int(yval)
Reason: Skin's metadata provision has several resolutions and getting the first (with a slice) does not mean it will be correct for any given setup. Parenthesis is also redundant.