Skip to content

Commit

Permalink
Fix lost state on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoSotoC committed Oct 28, 2024
1 parent 113e51d commit 787e3ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions music_assistant/server/providers/snapcast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ async def cmd_volume_set(self, player_id: str, volume_level: int) -> None:
async def cmd_stop(self, player_id: str) -> None:
"""Send STOP command to given player."""
player = self.mass.players.get(player_id, raise_unavailable=False)
player.elapsed_time = time.time()
if stream_task := self._stream_tasks.pop(player_id, None):
if not stream_task.done():
stream_task.cancel()
Expand Down

0 comments on commit 787e3ba

Please sign in to comment.