From ba191eafc78f11af360cd7ea37fcbc6efaa57479 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Tue, 12 Jul 2016 20:03:10 +0200 Subject: [PATCH] Improve code stability - NEVER use e.g. {} or [] as standard function arguments --- resources/lib/PlexAPI.py | 4 +++- resources/lib/playutils.py | 11 +++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 8c2942f4..24e9e448 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -2190,7 +2190,7 @@ class API(): """ return self.item[0].attrib.get('optimizedForStreaming') == '1' - def getTranscodeVideoPath(self, action, quality={}): + def getTranscodeVideoPath(self, action, quality=None): """ To be called on a VIDEO level of PMS xml response! @@ -2211,6 +2211,8 @@ class API(): TODO: mediaIndex """ + if quality is None: + quality = {} xargs = clientinfo.ClientInfo().getXArgsDeviceInfo() # For DirectPlay, path/key of PART is needed # trailers are 'clip' with PMS xmls diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 2deebd46..dd200345 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -55,14 +55,13 @@ class PlayUtils(): else: self.logMsg("File is transcoding.", 1) - quality = { - 'maxVideoBitrate': self.getBitrate(), - 'videoResolution': self.getResolution(), - 'videoQuality': '100' - } playurl = utils.tryEncode(self.API.getTranscodeVideoPath( 'Transcode', - quality=quality)) + quality={ + 'maxVideoBitrate': self.getBitrate(), + 'videoResolution': self.getResolution(), + 'videoQuality': '100' + })) # Set playmethod property utils.window('emby_%s.playmethod' % playurl, value="Transcode")