Fix playstate updates due to PMS websocket change

- Fixes #162
This commit is contained in:
tomkat83 2016-12-17 18:38:24 +01:00
parent 8438cc088c
commit 6b64f3b66c
2 changed files with 8 additions and 4 deletions

View file

@ -1392,9 +1392,9 @@ class LibrarySync(Thread):
"""
typus = message.get('type')
if typus == 'playing':
self.process_playing(message['_children'])
self.process_playing(message['PlaySessionStateNotification'])
elif typus == 'timeline':
self.process_timeline(message['_children'])
self.process_timeline(message['TimelineEntry'])
def multi_delete(self, liste, deleteListe):
"""

View file

@ -41,11 +41,15 @@ class WebSocket(threading.Thread):
log.error('Error decoding message from websocket: %s' % ex)
log.error(message)
return False
try:
message = message['NotificationContainer']
except KeyError:
log.error('Could not parse PMS message: %s' % message)
return False
# Triage
typus = message.get('type')
if typus is None:
log.debug('No message type, dropping message: %s' % message)
log.error('No message type, dropping message: %s' % message)
return False
log.debug('Received message from PMS server: %s' % message)
# Drop everything we're not interested in