fix for intros/cinema mode bug
This commit is contained in:
parent
033c2540e9
commit
75828e7eec
1 changed files with 30 additions and 22 deletions
|
@ -48,18 +48,6 @@ class PlaybackUtils():
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
# For split movies
|
|
||||||
if u'PartCount' in result:
|
|
||||||
partcount = result[u'PartCount']
|
|
||||||
# Get additional parts/playurl
|
|
||||||
url = "{server}/mediabrowser/Videos/%s/AdditionalParts" % id
|
|
||||||
parts = self.downloadUtils.downloadUrl(url)
|
|
||||||
partsId = [id]
|
|
||||||
for part in parts[u'Items']:
|
|
||||||
partId = part[u'Id']
|
|
||||||
partsId.append(partId)
|
|
||||||
self.PLAYAllItems(partsId, startPositionTicks=None)
|
|
||||||
|
|
||||||
userData = result['UserData']
|
userData = result['UserData']
|
||||||
resume_result = 0
|
resume_result = 0
|
||||||
seekTime = 0
|
seekTime = 0
|
||||||
|
@ -68,16 +56,36 @@ 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
|
itemsToPlay = []
|
||||||
|
# Check for intros
|
||||||
|
if seekTime == 0:
|
||||||
|
# if we have any play them when the movie/show is not being resumed
|
||||||
|
# We can add the option right here
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id
|
url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id
|
||||||
intros = self.downloadUtils.downloadUrl(url)
|
intros = self.downloadUtils.downloadUrl(url)
|
||||||
if(intros != "" and intros.get("Items") != None and seekTime == 0):
|
if intros[u'TotalRecordCount'] == 0:
|
||||||
introsId = []
|
pass
|
||||||
|
else:
|
||||||
for intro in intros[u'Items']:
|
for intro in intros[u'Items']:
|
||||||
introid = intro[u'Id']
|
introId = intro[u'Id']
|
||||||
introsId.append(introid)
|
itemsToPlay.append(introId)
|
||||||
introsId.append(id)
|
|
||||||
return self.PLAYAllItems(introsId, startPositionTicks=None)
|
# Add original item
|
||||||
|
itemsToPlay.append(id)
|
||||||
|
|
||||||
|
# For split movies
|
||||||
|
if u'PartCount' in result:
|
||||||
|
partcount = result[u'PartCount']
|
||||||
|
# Get additional parts/playurl
|
||||||
|
url = "{server}/mediabrowser/Videos/%s/AdditionalParts" % id
|
||||||
|
parts = self.downloadUtils.downloadUrl(url)
|
||||||
|
for part in parts[u'Items']:
|
||||||
|
partId = part[u'Id']
|
||||||
|
itemsToPlay.append(partId)
|
||||||
|
|
||||||
|
if len(itemsToPlay) > 1:
|
||||||
|
# Let's play the playlist
|
||||||
|
return self.AddToPlaylist(itemsToPlay)
|
||||||
|
|
||||||
playurl = PlayUtils().getPlayUrl(server, id, result)
|
playurl = PlayUtils().getPlayUrl(server, id, result)
|
||||||
if playurl == False:
|
if playurl == False:
|
||||||
|
|
Loading…
Reference in a new issue