Adjust new ask to play trailer setting

Ask only if there should be trailers to be played.
This commit is contained in:
angelblue05 2015-10-26 08:49:09 -05:00
parent a5562e896b
commit 6ba664037e

View file

@ -125,20 +125,20 @@ class PlaybackUtils():
if utils.settings('disableCinema') == "false" and not seekTime: if utils.settings('disableCinema') == "false" and not seekTime:
# if we have any play them when the movie/show is not being resumed # if we have any play them when the movie/show is not being resumed
getTrailers = True url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id
intros = doUtils.downloadUrl(url)
if utils.settings('askCinema') == "true": if intros['TotalRecordCount'] != 0:
resp = xbmcgui.Dialog().yesno("Emby Cinema Mode", "Play trailers?") getTrailers = True
if not resp:
# User selected to not play trailers
getTrailers = False
self.logMsg("Skip trailers.", 1)
if getTrailers: if utils.settings('askCinema') == "true":
url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id resp = xbmcgui.Dialog().yesno("Emby Cinema Mode", "Play trailers?")
intros = doUtils.downloadUrl(url) if not resp:
# User selected to not play trailers
getTrailers = False
self.logMsg("Skip trailers.", 1)
if intros['TotalRecordCount'] != 0: if getTrailers:
for intro in intros['Items']: for intro in intros['Items']:
# The server randomly returns intros, process them. # The server randomly returns intros, process them.
introId = intro['Id'] introId = intro['Id']