diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index cf6d6a26..47d3081a 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -2305,9 +2305,8 @@ class API(): def externalSubs(self, playurl): externalsubs = [] mapping = {} - item = self.item try: - mediastreams = item[0][self.part] + mediastreams = self.item[0][self.part] except (TypeError, KeyError, IndexError): return kodiindex = 0 diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 1cb985aa..cd37848c 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -280,33 +280,6 @@ class PlaybackUtils(): self.setArtwork(listitem) - def externalSubs(self, playurl): - externalsubs = [] - mapping = {} - - itemid = self.API.getRatingKey() - mediastreams = self.API.getMediaStreams() - - kodiindex = 0 - for stream in mediastreams: - - index = stream['Index'] - # Since Emby returns all possible tracks together, have to pull - # only external subtitles. IsTextSubtitleStream if true, is - # available to download from emby. - if (stream['Type'] == "Subtitle" and - stream['IsExternal'] and stream['IsTextSubtitleStream']): - # Direct stream - url = ("%s/Videos/%s/%s/Subtitles/%s/Stream.srt" - % (self.server, itemid, itemid, index)) - # map external subtitles for mapping - mapping[kodiindex] = index - externalsubs.append(url) - kodiindex += 1 - mapping = json.dumps(mapping) - window('emby_%s.indexMapping' % playurl, value=mapping) - return externalsubs - def setArtwork(self, listItem): allartwork = self.API.getAllArtwork(parentInfo=True) arttypes = {