Simplify code

This commit is contained in:
tomkat83 2017-03-05 16:41:56 +01:00
parent 799356c1fb
commit d2c52c1050

View file

@ -100,20 +100,11 @@ def process_command(request_path, params, queue=None):
convert_alexa_to_companion(params) convert_alexa_to_companion(params)
log.debug('Received request_path: %s, params: %s' % (request_path, params)) log.debug('Received request_path: %s, params: %s' % (request_path, params))
if "/playMedia" in request_path: if "/playMedia" in request_path:
try:
containerKey = urlparse(params.get('containerKey')).path
except:
containerKey = ''
try:
playQueueID = REGEX_PLAYQUEUES.findall(containerKey)[0]
except IndexError:
playQueueID = ''
# We need to tell service.py # We need to tell service.py
queue.put({ queue.put({
'action': 'playlist', 'action': 'playlist',
'data': params 'data': params
}) })
return
elif request_path == "player/playback/setParameters": elif request_path == "player/playback/setParameters":
if 'volume' in params: if 'volume' in params: