From 299e519cb7d7d7d752a0e84a49cfcb89d41791b6 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 3 Oct 2018 19:22:57 -0500 Subject: [PATCH] Fix source selection for direct stream --- resources/lib/helper/playutils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/lib/helper/playutils.py b/resources/lib/helper/playutils.py index 7464f4bd..7bb4c9ee 100644 --- a/resources/lib/helper/playutils.py +++ b/resources/lib/helper/playutils.py @@ -112,6 +112,7 @@ class PlayUtils(object): selection.append(source.get('Name', "na")) resp = dialog("select", _(33130), selection) + if resp > -1: source = sources[resp] else: @@ -175,6 +176,7 @@ class PlayUtils(object): def get(self, source, audio=None, subtitle=None): ''' The server returns sources based on the MaxStreamingBitrate value and other filters. + prop: embyfilename for ?? I thought it was to pass the real path to subtitle add-ons but it's not working? ''' self.info['MediaSourceId'] = source['Id'] @@ -199,6 +201,9 @@ class PlayUtils(object): self.info['SubtitleStreamIndex'] = self.info.get('SubtitleStreamIndex') or source.get('DefaultSubtitleStreamIndex') self.item['PlaybackInfo'].update(self.info) + API = api.API(self.item, self.info['ServerAddress']) + window('embyfilename', value=API.get_file_path(source.get('Path')).encode('utf-8')) + def live_stream(self, source): ''' Get live stream media info. @@ -259,8 +264,8 @@ class PlayUtils(object): source['Container'].split(',')[0], self.info['Token'])) else: - self.info['Path'] = ("%s/emby/Videos/%s/stream?static=true&api_key=%s" % - (self.info['ServerAddress'], self.item['Id'], self.info['Token'])) + self.info['Path'] = ("%s/emby/Videos/%s/stream?static=true&MediaSourceId=%s&api_key=%s" % + (self.info['ServerAddress'], self.item['Id'], source['Id'], self.info['Token'])) return self.info['Path']