set lang, only set screen res if full screen

This commit is contained in:
shaun 2016-10-16 11:12:57 +11:00
parent 99bf460bf1
commit 10318e0984
2 changed files with 11 additions and 5 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.emby" <addon id="plugin.video.emby"
name="Emby" name="Emby"
version="2.2.48" version="2.2.49"
provider-name="Emby.media"> provider-name="Emby.media">
<requires> <requires>
<import addon="xbmc.python" version="2.19.0"/> <import addon="xbmc.python" version="2.19.0"/>

View file

@ -34,8 +34,11 @@ class GoogleAnalytics():
self.user_name = md5.new(self.user_name).hexdigest() self.user_name = md5.new(self.user_name).hexdigest()
# resolution # resolution
self.height = xbmcgui.Window(10000).getHeight() self.screen_mode = xbmc.getInfoLabel("System.ScreenMode")
self.width = xbmcgui.Window(10000).getWidth() self.screen_height = xbmc.getInfoLabel("System.ScreenHeight")
self.screen_width = xbmc.getInfoLabel("System.ScreenWidth")
self.lang = xbmc.getInfoLabel("System.Language")
def getUserAgentOS(self): def getUserAgentOS(self):
@ -101,8 +104,11 @@ class GoogleAnalytics():
data['ec'] = eventCategory # Event Category data['ec'] = eventCategory # Event Category
data['ea'] = eventAction # Event Action data['ea'] = eventAction # Event Action
# add width and height # add width and height, only add if full screen
data['sr'] = str(self.width) + "x" + str(self.height) if(self.screen_mode.lower().find("window") == -1):
data['sr'] = str(self.screen_width) + "x" + str(self.screen_height)
data["ul"] = self.lang
if(eventLabel != None): if(eventLabel != None):
data['el'] = eventLabel # Event Label data['el'] = eventLabel # Event Label