added support for intros

This commit is contained in:
im85288 2015-06-05 15:46:17 +01:00
parent 23e039fd43
commit 8f8f39bb75

View file

@ -68,6 +68,17 @@ class PlaybackUtils():
reasonableTicks = int(userData.get("PlaybackPositionTicks")) / 1000 reasonableTicks = int(userData.get("PlaybackPositionTicks")) / 1000
seekTime = reasonableTicks / 10000 seekTime = reasonableTicks / 10000
# check for any intros - if we have any play them when the movie/show is not being resumed
url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id
intros = self.downloadUtils.downloadUrl(url)
if(intros != "" and intros.get("Items") != None and seekTime == 0):
introsId = []
for intro in intros[u'Items']:
introid = intro[u'Id']
introsId.append(introid)
introsId.append(id)
return self.PLAYAllItems(introsId, startPositionTicks=None)
playurl = PlayUtils().getPlayUrl(server, id, result) playurl = PlayUtils().getPlayUrl(server, id, result)
if playurl == False: if playurl == False:
#xbmcgui.Dialog().ok('Warning', 'Failed to launch playback.') #xbmcgui.Dialog().ok('Warning', 'Failed to launch playback.')