From 6ba664037e1520dcc19ef3529e655ee2838b280f Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 26 Oct 2015 08:49:09 -0500 Subject: [PATCH] Adjust new ask to play trailer setting Ask only if there should be trailers to be played. --- resources/lib/PlaybackUtils.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/lib/PlaybackUtils.py b/resources/lib/PlaybackUtils.py index bbbf0c1e..1172e52b 100644 --- a/resources/lib/PlaybackUtils.py +++ b/resources/lib/PlaybackUtils.py @@ -125,20 +125,20 @@ class PlaybackUtils(): if utils.settings('disableCinema') == "false" and not seekTime: # 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": - resp = xbmcgui.Dialog().yesno("Emby Cinema Mode", "Play trailers?") - if not resp: - # User selected to not play trailers - getTrailers = False - self.logMsg("Skip trailers.", 1) + if intros['TotalRecordCount'] != 0: + getTrailers = True - if getTrailers: - url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id - intros = doUtils.downloadUrl(url) - - if intros['TotalRecordCount'] != 0: + if utils.settings('askCinema') == "true": + resp = xbmcgui.Dialog().yesno("Emby Cinema Mode", "Play trailers?") + if not resp: + # User selected to not play trailers + getTrailers = False + self.logMsg("Skip trailers.", 1) + + if getTrailers: for intro in intros['Items']: # The server randomly returns intros, process them. introId = intro['Id']