Revert "Take into account item type for direct stream"

This reverts commit 53fbbffa75.
This commit is contained in:
angelblue05 2015-08-20 20:51:54 -05:00
parent afa582057a
commit 41fa61ada9
3 changed files with 14 additions and 11 deletions

View file

@ -204,7 +204,7 @@ def getThemeMedia():
if playback == "DirectPlay":
playurl = playUtils.directPlay(theme)
else:
playurl = playUtils.directStream(result, server, theme[u'Id'], "Video")
playurl = playUtils.directStream(result, server, theme[u'Id'], "ThemeVideo")
pathstowrite += ('<file>%s</file>' % playurl.encode('utf-8'))
# Check if the item has theme songs and add them

View file

@ -31,17 +31,12 @@ class PlayUtils():
className = self.__class__.__name__
utils.logMsg("%s %s" % (self.addonName, className), msg, int(lvl))
def getPlayUrl(self, server, id, result, type):
def getPlayUrl(self, server, id, result):
WINDOW = self.WINDOW
username = WINDOW.getProperty('currUser')
server = WINDOW.getProperty('server%s' % username)
if "Audio" in type:
type = "Audio"
else:
type = "Video"
if self.isDirectPlay(result,True):
# Try direct play
playurl = self.directPlay(result)
@ -51,7 +46,7 @@ class PlayUtils():
elif self.isDirectStream(result):
# Try direct stream
playurl = self.directStream(result, server, id, type)
playurl = self.directStream(result, server, id)
if playurl:
self.logMsg("File is direct streaming.", 1)
WINDOW.setProperty("%splaymethod" % playurl, "DirectStream")
@ -166,9 +161,18 @@ class PlayUtils():
def directStream(self, result, server, id, type = "Video"):
try:
if "Video" in type:
if "ThemeVideo" in type:
playurl ="%s/mediabrowser/Videos/%s/stream?static=true" % (server, id)
elif "Video" in type:
playurl = "%s/mediabrowser/Videos/%s/stream?static=true" % (server, id)
# Verify audio and subtitles
mediaSources = result[u'MediaSources']
if mediaSources[0].get('DefaultAudioStreamIndex') != None:
playurl = "%s&AudioStreamIndex=%s" % (playurl, mediaSources[0].get('DefaultAudioStreamIndex'))
if mediaSources[0].get('DefaultSubtitleStreamIndex') != None:
playurl = "%s&SubtitleStreamIndex=%s" % (playurl, mediaSources[0].get('DefaultSubtitleStreamIndex'))
elif "Audio" in type:
playurl = "%s/mediabrowser/Audio/%s/stream.mp3" % (server, id)

View file

@ -46,7 +46,6 @@ class PlaybackUtils():
try:
id = result["Id"]
type = result['Type']
except:
return
@ -91,7 +90,7 @@ class PlaybackUtils():
# Let's play the playlist
return self.AddToPlaylist(itemsToPlay)
playurl = PlayUtils().getPlayUrl(server, id, result, type)
playurl = PlayUtils().getPlayUrl(server, id, result)
if playurl == False or WINDOW.getProperty('playurlFalse') == "true":
WINDOW.clearProperty('playurlFalse')
xbmc.log("Failed to retrieve the playback path/url.")