From 3fb6443b2b61f51a7fba602c8aa229579eb8a301 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 26 Jun 2016 12:32:19 +0200 Subject: [PATCH] Let user always play trailer in highest quality --- resources/language/English/strings.xml | 1 + resources/language/German/strings.xml | 1 + resources/lib/PlexAPI.py | 14 ++++++++++++-- resources/settings.xml | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 8713312d..03acc478 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -305,6 +305,7 @@ Download additional art from FanArtTV (slower!) Download movie set/collection art from FanArtTV Don't ask to pick a certain stream/quality + Always pick best quality for trailers diff --git a/resources/language/German/strings.xml b/resources/language/German/strings.xml index 9dee7c20..cf8ecadd 100644 --- a/resources/language/German/strings.xml +++ b/resources/language/German/strings.xml @@ -31,6 +31,7 @@ Zusätzliche Bilder von FanArtTV herunterladen (langsamer!) FanArtTV Film-Sets/Collections Bilder herunterladen Nicht fragen, welcher Stream/Qualität gespielt wird + Trailer immer in der besten Qualität abspielen Verbindung Netzwerk diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 590b9ba5..8c2942f4 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -2213,11 +2213,21 @@ class API(): """ xargs = clientinfo.ClientInfo().getXArgsDeviceInfo() # For DirectPlay, path/key of PART is needed + # trailers are 'clip' with PMS xmls if action == "DirectStream": - if len(self.item) > 1 and utils.settings('bestQuality') == 'false': + # How many streams do we have? + count = 0 + for entry in self.item.findall('./Media'): + count += 1 + if (count > 1 and ( + (self.getType() != 'clip' and + utils.settings('bestQuality') == 'false') + or + (self.getType() == 'clip' and + utils.settings('bestTrailer') == 'false'))): # Several streams/files available. dialoglist = [] - for entry in self.item: + for entry in self.item.findall('./Media'): dialoglist.append( "%sp %s - %s (%s)" % (entry.attrib.get('videoResolution', 'unknown'), diff --git a/resources/settings.xml b/resources/settings.xml index c68b881b..f11066af 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -83,6 +83,7 @@ +