From 0c8587ceac3186767ac06681ef7372d8e43e85a5 Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Mon, 23 May 2016 19:33:56 -0400 Subject: [PATCH] Option to include paused content when requesting is media is playing. --- plexapi/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plexapi/client.py b/plexapi/client.py index deda11e2..e99cc245 100644 --- a/plexapi/client.py +++ b/plexapi/client.py @@ -173,8 +173,10 @@ class PlexClient(object): def timeline(self): return self.sendCommand('timeline/poll', **{'wait':1, 'commandID':4}) - def isPlayingMedia(self): + def isPlayingMedia(self, includePaused=False): for mediatype in self.timeline(): if mediatype.get('state') == 'playing': return True + if includePaused and mediatype.get('state') == 'paused': + return True return False