--- misc/xbmc/plugin.video.todic/default.py 2016/11/23 20:10:15 3147 +++ misc/xbmc/plugin.video.todic/default.py 2016/11/24 18:55:35 3150 @@ -3,7 +3,7 @@ ''' Todic plugin for XBMC - Version 0.0.19 + Version 0.0.21a ''' import sys @@ -85,10 +85,6 @@ self.url = url self.fetchClipDetails() - def setPosition(self, pos): - print "[Todic] MovieDialog setPosition:" + str(pos) - self.position = pos - def fetchClipDetails(self): @@ -97,6 +93,7 @@ self.clipkey = param1["clipkey"] print "CLIPKEY:" + self.clipkey detailurl = __backend__ + "&action=clipdetails&clipkey=" + self.clipkey + print "[Todic] detailURL = " + detailurl xml = open_url(detailurl) @@ -105,6 +102,7 @@ self.moviegroups = getText(doc.getElementsByTagName("moviegroups")) self.playlength = getText(doc.getElementsByTagName("playlength")) self.codecdetails = getText(doc.getElementsByTagName("codecdetails")) + self.position = int( getText(doc.getElementsByTagName("position")) ) def setName(self, name): self.name = name @@ -134,15 +132,17 @@ def onPlayBackStopped(self): self.stopped = True print "[TodicPlayer] : stopped" - url = __backend__ + "&action=playbacktime&subaction=stopped&time=" + str( self.playingPosition ) - open_url_safe(url) + self.reportPlaytime("stopped") +# url = __backend__ + "&action=playbacktime&subaction=stopped&time=" + str( self.playingPosition ) +# open_url_safe(url) def onPlayBackEnded(self): self.stopped = True print "[TodicPlayer] : ended" - url = __backend__ + "&action=playbacktime&subaction=ended&time=" - open_url_safe(url) + self.reportPlaytime("ended") +# url = __backend__ + "&action=playbacktime&subaction=ended&time=" + # open_url_safe(url) def tick(self): if ( self.isPlaying() ): @@ -151,13 +151,13 @@ #print "[Todic] tick " + str(now) + " " + str(self.lastReport) + " : " +str(now - self.lastReport) if ( (now - self.lastReport) > 60.0): self.lastReport = now - self.reportPlaytime() + self.reportPlaytime("playing") - def reportPlaytime(self): - url = __backend__ + "&action=playbacktime&subaction=playing&time=" + str( self.playingPosition ) + def reportPlaytime(self, subaction): + url = __backend__ + "&action=playbacktime&subaction=" + subaction + "&time=" + str( self.playingPosition ) open_url_safe(url) print "[Todic] reportPlaytime:" + url @@ -266,6 +266,7 @@ description = getText(entry.getElementsByTagName("description")) playcount = getText(entry.getElementsByTagName("playcount")) + if playcount == '': playcount = '0' playcount = int(playcount) @@ -304,7 +305,6 @@ d.setUrl(url) d.setName(name) d.setDescription(description) - d.setPosition(pos) #tager pos fra global scope d.doModal() @@ -452,7 +452,9 @@ name = None mode = None description = None -pos = 0 + + +#print params try: url = urllib.unquote_plus(params["url"]) @@ -471,10 +473,7 @@ except: pass -try: - pos = int(params["pos"]) -except: - pass + try: