Fix playcount

Remove duplicate api_key and MediaSourceId in stream transcode url
This commit is contained in:
angelblue05 2018-07-09 17:37:23 -05:00
parent 1051d415a5
commit 5502f4b0b3
3 changed files with 5 additions and 3 deletions

View file

@ -167,13 +167,13 @@ class KodiMonitor(xbmc.Monitor):
item_id = self._get_item_id(kodi_id, item_type) item_id = self._get_item_id(kodi_id, item_type)
if item_id: if item_id:
# Stop from manually marking as watched unwatched, with actual playback. # 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 # property is set in player.py
window('emby.skip.%s' % item_id, clear=True) window('emby.skip.%s' % item_id, clear=True)
else: else:
# notify the server # notify the server
url = "{server}/emby/Users/{UserId}/PlayedItems/%s?format=json" % item_id 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") self.download(url, action_type="POST")
log.info("Mark as watched for itemid: %s", item_id) log.info("Mark as watched for itemid: %s", item_id)
else: else:

View file

@ -453,6 +453,8 @@ class Player(xbmc.Player):
media_type = data['Type'] media_type = data['Type']
playMethod = data['playmethod'] playMethod = data['playmethod']
window('emby.skip.%s' % itemid, value="true")
self.stop_playback(data) self.stop_playback(data)
if currentPosition and runtime: if currentPosition and runtime:

View file

@ -276,7 +276,7 @@ class PlayUtils():
base, params = source['TranscodingUrl'].split("?") base, params = source['TranscodingUrl'].split("?")
url_parsed = params.split("&") url_parsed = params.split("&")
for i in url_parsed: 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_parsed.remove(i)
url = "%s/emby%s?%s" % (self.server, base.replace("stream", "master"), '&'.join(url_parsed)) url = "%s/emby%s?%s" % (self.server, base.replace("stream", "master"), '&'.join(url_parsed))
else: else: