add Kodi version to user agent string

This commit is contained in:
sfaulds 2016-10-17 14:21:40 +11:00
parent 10318e0984
commit 896fba3bbd

View file

@ -24,7 +24,15 @@ class GoogleAnalytics():
client_info = clientinfo.ClientInfo()
self.version = client_info.get_version()
self.device_id = client_info.get_device_id()
self.userAgent = "Kodi (" + self.getUserAgentOS() + ")"
# user agent string, used for OS and Kodi version identification
kodi_ver = xbmc.getInfoLabel("System.BuildVersion")
if(not kodi_ver):
kodi_ver = "na"
kodi_ver = kodi_ver.strip()
if(kodi_ver.find(" ") > 0):
kodi_ver = kodi_ver[0:kodi_ver.find(" ")]
self.userAgent = "Kodi/" + kodi_ver + " (" + self.getUserAgentOS() + ")"
# Use set user name
self.user_name = settings('username') or settings('connectUsername') or 'None'