From bf5616069018eae1cef32103460d820c2b5dd7c1 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 23 Feb 2018 16:53:06 +0100 Subject: [PATCH] Fix trailers --- resources/lib/PlexAPI.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 201cf734..e83293f2 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -645,14 +645,15 @@ class API(object): """ Returns the ratingKey (plex_id) of the trailer or None """ - for extra in self.item.iterfind('Extras'): - try: - typus = int(extra.attrib['extraType']) - except (KeyError, TypeError): - typus = None - if typus != 1: - continue - return extra.get('ratingKey') + for extras in self.item.iterfind('Extras'): + for extra in extras: + try: + typus = int(extra.attrib['extraType']) + except (KeyError, TypeError): + typus = None + if typus != 1: + continue + return extra.get('ratingKey') def mediastreams(self): """