From ca43b193574788933c0f405411df8b4c3152a62b Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Mon, 16 May 2016 16:09:21 +0200 Subject: [PATCH] Revert "Fix player runtime and current position" This reverts commit f9b0e69237b797bcc954cdc84a2abc916deafa60. --- resources/lib/player.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/lib/player.py b/resources/lib/player.py index 5c0efac7..70dc67a4 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -222,7 +222,7 @@ class Player(xbmc.Player): 'playQueueVersion': playQueueVersion, 'playQueueID': playQueueID, 'playQueueItemID': playQueueItemID, - 'runtime': runtime, + 'runtime': runtime * 1000, 'item_id': itemId, 'refresh_id': refresh_id, 'currentfile': currentFile, @@ -477,7 +477,7 @@ class Player(xbmc.Player): if currentPosition and runtime: try: - percentComplete = float(currentPosition) / float(runtime) + percentComplete = currentPosition / int(runtime) except ZeroDivisionError: # Runtime is 0. percentComplete = 0 @@ -485,8 +485,6 @@ class Player(xbmc.Player): markPlayedAt = float(settings('markPlayed')) / 100 self.logMsg("Percent complete: %s Mark played at: %s" % (percentComplete, markPlayedAt), 1) - if percentComplete >= markPlayedAt: - # Send the delete action to the server. offerDelete = False @@ -551,7 +549,7 @@ class Player(xbmc.Player): args = { 'ratingKey': itemId, 'state': 'stopped', # 'stopped', 'paused', 'buffering', 'playing' - 'time': int(playTime), + 'time': int(playTime) * 1000, 'duration': int(duration) } url = url + urlencode(args)