Handle live content better in Kodi (#4388)

This commit is contained in:
Lewis Juggins 2016-11-15 04:11:22 +00:00 committed by Paulus Schoutsen
parent 7f5f458074
commit 4c37ee8884

View file

@ -104,7 +104,7 @@ class KodiDevice(MediaPlayerDevice):
if len(self._players) == 0: if len(self._players) == 0:
return STATE_IDLE return STATE_IDLE
if self._properties['speed'] == 0: if self._properties['speed'] == 0 and not self._properties['live']:
return STATE_PAUSED return STATE_PAUSED
else: else:
return STATE_PLAYING return STATE_PLAYING
@ -120,7 +120,7 @@ class KodiDevice(MediaPlayerDevice):
self._properties = self._server.Player.GetProperties( self._properties = self._server.Player.GetProperties(
player_id, player_id,
['time', 'totaltime', 'speed'] ['time', 'totaltime', 'speed', 'live']
) )
self._item = self._server.Player.GetItem( self._item = self._server.Player.GetItem(
@ -163,7 +163,7 @@ class KodiDevice(MediaPlayerDevice):
@property @property
def media_duration(self): def media_duration(self):
"""Duration of current playing media in seconds.""" """Duration of current playing media in seconds."""
if self._properties is not None: if self._properties is not None and not self._properties['live']:
total_time = self._properties['totaltime'] total_time = self._properties['totaltime']
return ( return (