Skip to content

Commit

Permalink
new postplay screen
Browse files Browse the repository at this point in the history
  • Loading branch information
im85288 committed Jan 6, 2017
1 parent e60d0cf commit 91b0262
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<addon id="service.nextup.notification" name="Nextup Service Notification" provider-name="im85288" version="1.0.28">
<addon id="service.nextup.notification" name="Nextup Service Notification" provider-name="im85288" version="1.0.29">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.addon.signals" version="0.0.1"/>
Expand Down
5 changes: 5 additions & 0 deletions resources/lib/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def onPlayBackEnded(self):
if self.postplaywindow is not None:
ga = GoogleAnalytics()
ga.sendEventData("PlayAction", "Ended", "Post Play Shown")
ga.sendScreenView("Post Play Screen")
self.showPostPlay()

def iStream_fix(self, show_npid, showtitle, episode_np, season_np):
Expand Down Expand Up @@ -603,20 +604,24 @@ def autoPlayPlayback(self):
totalTime = xbmc.Player().getTotalTime()
self.logMsg("played in a row settings %s" % str(playedinarownumber), 2)
self.logMsg("played in a row %s" % str(self.playedinarow), 2)

ga = GoogleAnalytics()
if int(self.playedinarow) <= int(playedinarownumber):
self.logMsg(
"showing next up page as played in a row is %s" % str(self.playedinarow), 2)
if (shortplayNotification == "false") and (shortplayLength >= totalTime) and (shortplayMode == "true"):
self.logMsg("hiding notification for short videos")
else:
nextUpPage.show()
ga.sendScreenView("Next Up Screen")
else:
self.logMsg(
"showing still watching page as played in a row %s" % str(self.playedinarow), 2)
if (shortplayNotification == "false") and (shortplayLength >= totalTime) and (shortplayMode == "true"):
self.logMsg("hiding notification for short videos")
else:
stillWatchingPage.show()
ga.sendScreenView("Still Watching Screen")
while xbmc.Player().isPlaying() and (
totalTime - playTime > 1) and not nextUpPage.isCancel() and not nextUpPage.isWatchNow() and not stillWatchingPage.isStillWatching() and not stillWatchingPage.isCancel():
xbmc.sleep(100)
Expand Down
8 changes: 8 additions & 0 deletions resources/lib/ga_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ def sendEventData(self, eventCategory, eventAction, eventLabel=None):
data['el'] = eventLabel # Event Label

self.sendData(data)

def sendScreenView(self, name):

data = self.getBaseData()
data['t'] = 'screenview' # action type
data['cd'] = name

self.sendData(data)

def sendData(self, data):

Expand Down

0 comments on commit 91b0262

Please sign in to comment.