--- misc/xbmc/plugin.video.todic/default.py 2016/12/08 09:47:21 3165 +++ misc/xbmc/plugin.video.todic/default.py 2019/02/18 17:38:13 3244 @@ -3,7 +3,7 @@ ''' Todic plugin for XBMC - Version 0.1.6 + Version 1.7.1 ''' import sys @@ -24,7 +24,19 @@ __addon__ = xbmcaddon.Addon(id='plugin.video.todic') __key__ = __addon__.getSetting('xbmckey').lower() +__entrypoint__ = __addon__.getSetting('entrypoint').lower() __backend__ = "https://todic.dk/xbmc.php?xbmckey=" + __key__ + +if __entrypoint__ == "alternative": + __backend__ = "https://alt.todic.dk/xbmc.php?xbmckey=" + __key__ + +if __entrypoint__ == "testing": + __backend__ = "https://todic.dk/xbmc-beta.php?xbmckey=" + __key__ + +print "[Todic] entrypoint: " + __entrypoint__ +print "[Todic] backend: " + __backend__ + + fanartImage = os.path.join(__addon__.getAddonInfo('path'), 'movie_bg_blur.jpg') datapath = xbmc.translatePath( 'special://profile/addon_data/plugin.video.todic/') @@ -136,12 +148,16 @@ def tick(self): #print "[Todic] Tick: " + str( self.isPlaying() ) if ( self.isPlaying() ): - self.playingPosition = self.getTime() - now = time() - #print "[Todic] tick " + str(now) + " " + str(self.lastReport) + " : " +str(now - self.lastReport) - if ( (now - self.lastReport) > 60.0): - self.lastReport = now - self.reportPlaytime("playing") + tmpTime = self.getTime(): + + #only report time if it has changed in the mean time + if tmpTime != self.playingPosition: + self.playingPosition = tmpTime + now = time() + #print "[Todic] tick " + str(now) + " " + str(self.lastReport) + " : " +str(now - self.lastReport) + if ( (now - self.lastReport) > 60.0): + self.lastReport = now + self.reportPlaytime("playing") def reportPlaytime(self, subaction): if (self.playingPosition > 60):