Improve code stability
- NEVER use e.g. {} or [] as standard function arguments
This commit is contained in:
parent
90e67931ff
commit
ba191eafc7
2 changed files with 8 additions and 7 deletions
|
@ -2190,7 +2190,7 @@ class API():
|
||||||
"""
|
"""
|
||||||
return self.item[0].attrib.get('optimizedForStreaming') == '1'
|
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!
|
To be called on a VIDEO level of PMS xml response!
|
||||||
|
@ -2211,6 +2211,8 @@ class API():
|
||||||
|
|
||||||
TODO: mediaIndex
|
TODO: mediaIndex
|
||||||
"""
|
"""
|
||||||
|
if quality is None:
|
||||||
|
quality = {}
|
||||||
xargs = clientinfo.ClientInfo().getXArgsDeviceInfo()
|
xargs = clientinfo.ClientInfo().getXArgsDeviceInfo()
|
||||||
# For DirectPlay, path/key of PART is needed
|
# For DirectPlay, path/key of PART is needed
|
||||||
# trailers are 'clip' with PMS xmls
|
# trailers are 'clip' with PMS xmls
|
||||||
|
|
|
@ -55,14 +55,13 @@ class PlayUtils():
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.logMsg("File is transcoding.", 1)
|
self.logMsg("File is transcoding.", 1)
|
||||||
|
playurl = utils.tryEncode(self.API.getTranscodeVideoPath(
|
||||||
|
'Transcode',
|
||||||
quality={
|
quality={
|
||||||
'maxVideoBitrate': self.getBitrate(),
|
'maxVideoBitrate': self.getBitrate(),
|
||||||
'videoResolution': self.getResolution(),
|
'videoResolution': self.getResolution(),
|
||||||
'videoQuality': '100'
|
'videoQuality': '100'
|
||||||
}
|
}))
|
||||||
playurl = utils.tryEncode(self.API.getTranscodeVideoPath(
|
|
||||||
'Transcode',
|
|
||||||
quality=quality))
|
|
||||||
# Set playmethod property
|
# Set playmethod property
|
||||||
utils.window('emby_%s.playmethod' % playurl, value="Transcode")
|
utils.window('emby_%s.playmethod' % playurl, value="Transcode")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue