Option to include paused content when requesting is media is playing.

This commit is contained in:
Michael Shepanski 2016-05-23 19:33:56 -04:00
parent 36b5d12a19
commit 0c8587ceac

View file

@ -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