Fix Spotify deviding None value in current progress (#76581)
parent
dbfba3a951
commit
6e65cb4928
|
@ -179,7 +179,10 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
||||||
@property
|
@property
|
||||||
def media_position(self) -> int | None:
|
def media_position(self) -> int | None:
|
||||||
"""Position of current playing media in seconds."""
|
"""Position of current playing media in seconds."""
|
||||||
if not self._currently_playing:
|
if (
|
||||||
|
not self._currently_playing
|
||||||
|
or self._currently_playing.get("progress_ms") is None
|
||||||
|
):
|
||||||
return None
|
return None
|
||||||
return self._currently_playing["progress_ms"] / 1000
|
return self._currently_playing["progress_ms"] / 1000
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue