From 7c6451e839876564e7b4baa3a73eb139f49b034f Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 26 Mar 2016 16:52:33 -0500 Subject: [PATCH] Fix to local trailers For some reason, server reports local trailer, then querying may or may not return a result --- resources/lib/itemtypes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 4b641f8f..f3f03ca6 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -337,7 +337,11 @@ class Movies(Items): % itemid ) result = self.doUtils.downloadUrl(url) - trailer = "plugin://plugin.video.emby/trailer/?id=%s&mode=play" % result[0]['Id'] + try: + 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: # Try to get the youtube trailer try: @@ -348,7 +352,7 @@ class Movies(Items): try: trailerId = trailer.rsplit('=', 1)[1] except IndexError: - self.logMsg("Failed to process trailer: %s" % trailer) + self.logMsg("Failed to process trailer: %s" % trailer, 1) trailer = None else: trailer = "plugin://plugin.video.youtube/play/?video_id=%s" % trailerId