How to determine Kodi version via code?
#1
There is any way to know what kodi version is running the addon?
Reply
#2
You can see it here using Estuary:

Image
Reply
#3
Thanx, but it not what I meant.
I meant with code, so in the code of some addon I will get the Kodi version :]
Reply
#4
I don't understand what you mean, the Kodi version is whatever version you are running. Do you want to know python versions? An example of what you mean would probably help Smile
Reply
#5
No, i want to get the Kodi version (aka 17.2 today) with python code... there is any API for that?
Reply
#6
try:
Code:
xbmc.getInfoLabel('System.BuildVersion')
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#7
obviously Ronie knows better, but I've been using below function to return version.

Code:
def get_installedversion():
    # retrieve current installed version
    json_query = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "Application.GetProperties", "params": {"properties": ["version", "name"]}, "id": 1 }')
    json_query = unicode(json_query, 'utf-8', errors='ignore')
    json_query = json.loads(json_query)
    version_installed = []
    if json_query.has_key('result') and json_query['result'].has_key('version'):
        version_installed  = json_query['result']['version']['major']
    return str(version_installed)
Reply
#8
Somehow, Ronie's version seems simpler... Smile Smile Smile
Reply
#9
Each xbmc module also has version attribute, ie xbmc.__version__ or xbmcgui.__version__ . İf you need versioning for api changes, versioning modules intead of kodi itself may aloso be handy.
Reply
#10
Thnax!
Reply

Logout Mark Read Team Forum Stats Members Help
How to determine Kodi version via code?0