From 1245b4fbd393ba4e2d3054a17bd5f2b2c5939e20 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 27 May 2018 14:04:47 -0700 Subject: [PATCH] Hack to check for live tv stopped websocket event --- plexpy/activity_handler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plexpy/activity_handler.py b/plexpy/activity_handler.py index 735d47f7..8fed58e7 100644 --- a/plexpy/activity_handler.py +++ b/plexpy/activity_handler.py @@ -43,6 +43,9 @@ class ActivityHandler(object): if 'sessionKey' in self.timeline: if str(self.timeline['sessionKey']).isdigit(): return True + # Hack since sessionKey is not in the live TV stopped event + elif self.timeline.get('key', '').startswith('/livetv/sessions') and self.timeline.get('state') == 'stopped': + return True return False