mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Fix resume point
Move stop transcode and stop playback out of the currentposition, runtime verification.
This commit is contained in:
parent
7ab8e3e231
commit
e30e20104d
1 changed files with 12 additions and 11 deletions
|
@ -455,6 +455,9 @@ class Player(xbmc.Player):
|
|||
type = data['Type']
|
||||
playMethod = data['playmethod']
|
||||
|
||||
# Prevent manually mark as watched in Kodi monitor
|
||||
utils.window('emby_skipWatched%s' % itemid, value="true")
|
||||
|
||||
if currentPosition and runtime:
|
||||
try:
|
||||
percentComplete = (currentPosition * 10000000) / int(runtime)
|
||||
|
@ -466,17 +469,6 @@ class Player(xbmc.Player):
|
|||
log("Percent complete: %s Mark played at: %s"
|
||||
% (percentComplete, markPlayedAt), 1)
|
||||
|
||||
# Prevent manually mark as watched in Kodi monitor
|
||||
utils.window('emby_skipWatched%s' % itemid, value="true")
|
||||
|
||||
self.stopPlayback(data)
|
||||
# Stop transcoding
|
||||
if playMethod == "Transcode":
|
||||
log("Transcoding for %s terminated." % itemid, 1)
|
||||
deviceId = self.clientInfo.getDeviceId()
|
||||
url = "{server}/emby/Videos/ActiveEncodings?DeviceId=%s" % deviceId
|
||||
doUtils(url, type="DELETE")
|
||||
|
||||
# Send the delete action to the server.
|
||||
offerDelete = False
|
||||
|
||||
|
@ -499,6 +491,15 @@ class Player(xbmc.Player):
|
|||
log("Deleting request: %s" % itemid, 1)
|
||||
doUtils(url, type="DELETE")
|
||||
|
||||
self.stopPlayback(data)
|
||||
|
||||
# Stop transcoding
|
||||
if playMethod == "Transcode":
|
||||
log("Transcoding for %s terminated." % itemid, 1)
|
||||
deviceId = self.clientInfo.getDeviceId()
|
||||
url = "{server}/emby/Videos/ActiveEncodings?DeviceId=%s" % deviceId
|
||||
doUtils(url, type="DELETE")
|
||||
|
||||
self.played_info.clear()
|
||||
|
||||
def stopPlayback(self, data):
|
||||
|
|
Loading…
Reference in a new issue