add metric collection to play actions

This commit is contained in:
sfaulds 2016-10-10 09:50:53 +11:00
parent f6f6ae81e4
commit d5d63263a9

View file

@ -14,6 +14,7 @@ import downloadutils
import kodidb_functions as kodidb import kodidb_functions as kodidb
import websocket_client as wsc import websocket_client as wsc
from utils import window, settings, language as lang from utils import window, settings, language as lang
from ga_client import GoogleAnalytics
################################################################################################# #################################################################################################
@ -28,7 +29,6 @@ class Player(xbmc.Player):
_shared_state = {} _shared_state = {}
played_info = {} played_info = {}
playStats = {}
currentFile = None currentFile = None
@ -44,10 +44,6 @@ class Player(xbmc.Player):
log.debug("Starting playback monitor.") log.debug("Starting playback monitor.")
xbmc.Player.__init__(self) xbmc.Player.__init__(self)
def GetPlayStats(self):
return self.playStats
def onPlayBackStarted(self): def onPlayBackStarted(self):
# Will be called when xbmc starts playing a file # Will be called when xbmc starts playing a file
self.stopAll() self.stopAll()
@ -233,20 +229,8 @@ class Player(xbmc.Player):
self.played_info[currentFile] = data self.played_info[currentFile] = data
log.info("ADDING_FILE: %s" % self.played_info) log.info("ADDING_FILE: %s" % self.played_info)
# log some playback stats ga = GoogleAnalytics()
'''if(itemType != None): ga.sendEventData("PlayAction", itemType, playMethod)
if(self.playStats.get(itemType) != None):
count = self.playStats.get(itemType) + 1
self.playStats[itemType] = count
else:
self.playStats[itemType] = 1
if(playMethod != None):
if(self.playStats.get(playMethod) != None):
count = self.playStats.get(playMethod) + 1
self.playStats[playMethod] = count
else:
self.playStats[playMethod] = 1'''
def reportPlayback(self): def reportPlayback(self):