Skip to content

Commit

Permalink
Fix bug in roon media player to use correct 'seek position' while pla…
Browse files Browse the repository at this point in the history
…ying a track. (home-assistant#113999)

Chance source of 'seek position' to be the one that roon updates while playing!
  • Loading branch information
pavoni authored Mar 23, 2024
1 parent 1a6ff5c commit 3ec9312
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homeassistant/components/roon/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,13 @@ def _parse_now_playing(self, player_data):
}
now_playing_data = None

media_position = convert(player_data.get("seek_position"), int, 0)

try:
now_playing_data = player_data["now_playing"]
media_title = now_playing_data["three_line"]["line1"]
media_artist = now_playing_data["three_line"]["line2"]
media_album_name = now_playing_data["three_line"]["line3"]
media_position = convert(now_playing_data["seek_position"], int, 0)
media_duration = convert(now_playing_data.get("length"), int, 0)
image_id = now_playing_data.get("image_key")
except KeyError:
Expand Down

0 comments on commit 3ec9312

Please sign in to comment.