From 5502f4b0b3dc2d7bba3f0fb7b0a4b5bc9278df11 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 9 Jul 2018 17:37:23 -0500 Subject: [PATCH] Fix playcount Remove duplicate api_key and MediaSourceId in stream transcode url --- resources/lib/kodimonitor.py | 4 ++-- resources/lib/player.py | 2 ++ resources/lib/playutils.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 5a16f2f0..93d5b48a 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -167,13 +167,13 @@ class KodiMonitor(xbmc.Monitor): item_id = self._get_item_id(kodi_id, item_type) if item_id: # Stop from manually marking as watched unwatched, with actual playback. - if window('emby.skip.%s' % item_id) == "true": + if window('emby.skip.%s' % item_id): # property is set in player.py window('emby.skip.%s' % item_id, clear=True) else: # notify the server url = "{server}/emby/Users/{UserId}/PlayedItems/%s?format=json" % item_id - if data.get('playcount') != 0: + if data.get('playcount'): self.download(url, action_type="POST") log.info("Mark as watched for itemid: %s", item_id) else: diff --git a/resources/lib/player.py b/resources/lib/player.py index d4607d1c..8d5d8d2a 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -453,6 +453,8 @@ class Player(xbmc.Player): media_type = data['Type'] playMethod = data['playmethod'] + window('emby.skip.%s' % itemid, value="true") + self.stop_playback(data) if currentPosition and runtime: diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index f4b837f0..bf52fa04 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -276,7 +276,7 @@ class PlayUtils(): base, params = source['TranscodingUrl'].split("?") url_parsed = params.split("&") for i in url_parsed: - if 'AudioStreamIndex' in i or 'AudioBitrate' in i: #handle manually + if 'AudioStreamIndex' in i or 'AudioBitrate' in i or 'PlaySessionId' in i or 'MediaSourceId' in i or 'api_key' in i: #handle manually url_parsed.remove(i) url = "%s/emby%s?%s" % (self.server, base.replace("stream", "master"), '&'.join(url_parsed)) else: