Skip to content

Commit

Permalink
Small fix in common.py, getting Kodi major version as int
Browse files Browse the repository at this point in the history
  • Loading branch information
bossanova808 committed Apr 18, 2024
1 parent 80c7276 commit df65a85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
Handy utility functions & constants for Kodi Addons
For Kodi Matrix & later
By bossanova808 - freely released
VERSION 0.2.6 2024-04-11
VERSION 0.2.7 2024-04-19
Changelog:
0.2.7 - Fix getting the major Kodi version (& change float -> int), as it was failing on e.g. 'RC' being in the string apparently
0.2.6 - (SkinPatcher) - add float KODI_VERSION_FLOAT constant, alongside string KODI_VERSION
0.2.5 - (Skin) - move to storing copy of latest in bossanova808 repo and adding this mini changelog
Expand Down Expand Up @@ -38,7 +39,7 @@
LANGUAGE = ADDON.getLocalizedString
PROFILE = xbmcvfs.translatePath(ADDON.getAddonInfo('profile'))
KODI_VERSION = xbmc.getInfoLabel('System.BuildVersion')
KODI_VERSION_FLOAT = float(KODI_VERSION.split("(")[0])
KODI_VERSION_INT = int(KODI_VERSION.split(".")[0])
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
HOME_WINDOW = xbmcgui.Window(10000)
WEATHER_WINDOW = xbmcgui.Window(12600)
Expand Down Expand Up @@ -207,7 +208,7 @@ def footprints(startup=True):
"""
if startup:
log(f'Starting...', level=xbmc.LOGINFO)
log(f'Kodi Version: {KODI_VERSION}, as float {KODI_VERSION_FLOAT}', level=xbmc.LOGINFO)
log(f'Kodi System.BuildVersion: {KODI_VERSION}, which is Kodi major version: {KODI_VERSION_INT}', level=xbmc.LOGINFO)
log(f'Addon arguments: {ADDON_ARGUMENTS}', level=xbmc.LOGINFO)
else:
log(f'Exiting...', level=xbmc.LOGINFO)
Expand Down

0 comments on commit df65a85

Please sign in to comment.