Fix to local trailers

For some reason, server reports local trailer, then querying may or may
not return a result
This commit is contained in:
angelblue05 2016-03-26 16:52:33 -05:00
parent a7f70a3145
commit 7c6451e839

View file

@ -337,7 +337,11 @@ class Movies(Items):
% itemid % itemid
) )
result = self.doUtils.downloadUrl(url) result = self.doUtils.downloadUrl(url)
try:
trailer = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % result[0]['Id'] trailer = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % result[0]['Id']
except IndexError:
self.logMsg("Failed to process local trailer.", 1)
trailer = None
else: else:
# Try to get the youtube trailer # Try to get the youtube trailer
try: try:
@ -348,7 +352,7 @@ class Movies(Items):
try: try:
trailerId = trailer.rsplit('=', 1)[1] trailerId = trailer.rsplit('=', 1)[1]
except IndexError: except IndexError:
self.logMsg("Failed to process trailer: %s" % trailer) self.logMsg("Failed to process trailer: %s" % trailer, 1)
trailer = None trailer = None
else: else:
trailer = "plugin://plugin.video.youtube/play/?video_id=%s" % trailerId trailer = "plugin://plugin.video.youtube/play/?video_id=%s" % trailerId