Revert "Fix player runtime and current position"

This reverts commit f9b0e69237.
This commit is contained in:
tomkat83 2016-05-16 16:09:21 +02:00
parent f9b0e69237
commit ca43b19357

View file

@ -222,7 +222,7 @@ class Player(xbmc.Player):
'playQueueVersion': playQueueVersion, 'playQueueVersion': playQueueVersion,
'playQueueID': playQueueID, 'playQueueID': playQueueID,
'playQueueItemID': playQueueItemID, 'playQueueItemID': playQueueItemID,
'runtime': runtime, 'runtime': runtime * 1000,
'item_id': itemId, 'item_id': itemId,
'refresh_id': refresh_id, 'refresh_id': refresh_id,
'currentfile': currentFile, 'currentfile': currentFile,
@ -477,7 +477,7 @@ class Player(xbmc.Player):
if currentPosition and runtime: if currentPosition and runtime:
try: try:
percentComplete = float(currentPosition) / float(runtime) percentComplete = currentPosition / int(runtime)
except ZeroDivisionError: except ZeroDivisionError:
# Runtime is 0. # Runtime is 0.
percentComplete = 0 percentComplete = 0
@ -485,8 +485,6 @@ class Player(xbmc.Player):
markPlayedAt = float(settings('markPlayed')) / 100 markPlayedAt = float(settings('markPlayed')) / 100
self.logMsg("Percent complete: %s Mark played at: %s" self.logMsg("Percent complete: %s Mark played at: %s"
% (percentComplete, markPlayedAt), 1) % (percentComplete, markPlayedAt), 1)
if percentComplete >= markPlayedAt:
# Send the delete action to the server. # Send the delete action to the server.
offerDelete = False offerDelete = False
@ -551,7 +549,7 @@ class Player(xbmc.Player):
args = { args = {
'ratingKey': itemId, 'ratingKey': itemId,
'state': 'stopped', # 'stopped', 'paused', 'buffering', 'playing' 'state': 'stopped', # 'stopped', 'paused', 'buffering', 'playing'
'time': int(playTime), 'time': int(playTime) * 1000,
'duration': int(duration) 'duration': int(duration)
} }
url = url + urlencode(args) url = url + urlencode(args)