mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-30 19:40:08 -07:00
Decode websocket data
This commit is contained in:
parent
6c8b425fb3
commit
6d23ef9105
1 changed files with 5 additions and 4 deletions
|
@ -246,6 +246,7 @@ def process(opcode, data):
|
|||
return False
|
||||
|
||||
try:
|
||||
data = data.decode('utf-8')
|
||||
logger.websocket_debug(data)
|
||||
info = json.loads(data)
|
||||
except Exception as e:
|
||||
|
@ -254,12 +255,12 @@ def process(opcode, data):
|
|||
return False
|
||||
|
||||
info = info.get('NotificationContainer', info)
|
||||
type = info.get('type')
|
||||
info_type = info.get('type')
|
||||
|
||||
if not type:
|
||||
if not info_type:
|
||||
return False
|
||||
|
||||
if type == 'playing':
|
||||
if info_type == 'playing':
|
||||
time_line = info.get('PlaySessionStateNotification', info.get('_children', {}))
|
||||
|
||||
if not time_line:
|
||||
|
@ -272,7 +273,7 @@ def process(opcode, data):
|
|||
except Exception as e:
|
||||
logger.exception("Tautulli WebSocket :: Failed to process session data: %s." % e)
|
||||
|
||||
if type == 'timeline':
|
||||
if info_type == 'timeline':
|
||||
time_line = info.get('TimelineEntry', info.get('_children', {}))
|
||||
|
||||
if not time_line:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue