mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Handle live content better in Kodi (#4388)
This commit is contained in:
parent
7f5f458074
commit
4c37ee8884
@ -104,7 +104,7 @@ class KodiDevice(MediaPlayerDevice):
|
||||
if len(self._players) == 0:
|
||||
return STATE_IDLE
|
||||
|
||||
if self._properties['speed'] == 0:
|
||||
if self._properties['speed'] == 0 and not self._properties['live']:
|
||||
return STATE_PAUSED
|
||||
else:
|
||||
return STATE_PLAYING
|
||||
@ -120,7 +120,7 @@ class KodiDevice(MediaPlayerDevice):
|
||||
|
||||
self._properties = self._server.Player.GetProperties(
|
||||
player_id,
|
||||
['time', 'totaltime', 'speed']
|
||||
['time', 'totaltime', 'speed', 'live']
|
||||
)
|
||||
|
||||
self._item = self._server.Player.GetItem(
|
||||
@ -163,7 +163,7 @@ class KodiDevice(MediaPlayerDevice):
|
||||
@property
|
||||
def media_duration(self):
|
||||
"""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']
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user