mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
fix playback report
This commit is contained in:
parent
93525652ae
commit
68bf8655f3
4 changed files with 9 additions and 25 deletions
|
@ -488,8 +488,6 @@ class Artwork(object):
|
|||
artworks = item['ImageTags']
|
||||
backdrops = item.get('BackdropImageTags', [])
|
||||
|
||||
max_height = 10000
|
||||
max_width = 10000
|
||||
custom_query = ""
|
||||
|
||||
if settings('compressArt') == "true":
|
||||
|
|
|
@ -378,9 +378,8 @@ class Player(xbmc.Player):
|
|||
data['SubtitleStreamIndex'], postdata['SubtitleStreamIndex'] = [""] * 2
|
||||
|
||||
# Report progress via websocketclient
|
||||
postdata = json.dumps(postdata)
|
||||
log.debug("Report: %s" % postdata)
|
||||
self.ws.send_progress_update(postdata)
|
||||
log.debug("Report: %s", postdata)
|
||||
self.emby.progress_report(postdata)
|
||||
|
||||
@log_error()
|
||||
def onPlayBackPaused(self):
|
||||
|
@ -528,7 +527,7 @@ class Player(xbmc.Player):
|
|||
|
||||
def stop_playback(self, data):
|
||||
|
||||
log.debug("stop playback called.")
|
||||
log.info("stop playback called.")
|
||||
|
||||
position_ticks = int(data['currentPosition'] * 10000000)
|
||||
position = data['runtime'] if position_ticks and window('emby.external') else position_ticks
|
||||
|
|
|
@ -673,7 +673,7 @@ class Read_EmbyServer():
|
|||
|
||||
def stop_playback(self, item_id, position, playsession_id, mediasource_id=None):
|
||||
|
||||
url = self.get_emby_url('/Sessions/Playing/Stopped')
|
||||
url = self.get_emby_url('Sessions/Playing/Stopped')
|
||||
return self.doUtils.downloadUrl(url, action_type="POST", postBody={
|
||||
|
||||
'ItemId': item_id,
|
||||
|
@ -681,3 +681,7 @@ class Read_EmbyServer():
|
|||
'PositionTicks': position,
|
||||
'PlaySessionId': playsession_id
|
||||
})
|
||||
|
||||
def progress_report(self, data):
|
||||
url = self.get_emby_url('Sessions/Playing/Progress')
|
||||
return self.doUtils.downloadUrl(url, action_type="POST", postBody=data)
|
||||
|
|
|
@ -45,23 +45,6 @@ class WebSocketClient(threading.Thread):
|
|||
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
|
||||
def send_progress_update(self, data):
|
||||
|
||||
log.debug("sendProgressUpdate")
|
||||
try:
|
||||
message = {
|
||||
|
||||
'MessageType': "ReportPlaybackProgress",
|
||||
'Data': data
|
||||
}
|
||||
message_str = json.dumps(message)
|
||||
self._client.send(message_str)
|
||||
log.debug("Message data: %s", message_str)
|
||||
|
||||
except Exception as error:
|
||||
log.exception(error)
|
||||
|
||||
@log_error()
|
||||
def on_message(self, ws, message):
|
||||
|
||||
|
@ -364,7 +347,7 @@ class WebSocketClient(threading.Thread):
|
|||
if self._stop_websocket:
|
||||
break
|
||||
|
||||
if self.monitor.waitForAbort(10):
|
||||
if self.monitor.waitForAbort(5):
|
||||
# Abort was requested, exit
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in a new issue