From 787e3ba557326605dcf45462346df54048c61a7c Mon Sep 17 00:00:00 2001 From: Santiago Soto Date: Mon, 28 Oct 2024 17:15:24 -0300 Subject: [PATCH] Fix lost state on stop --- music_assistant/server/providers/snapcast/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/music_assistant/server/providers/snapcast/__init__.py b/music_assistant/server/providers/snapcast/__init__.py index 0cc1b5238..8f61b7e10 100644 --- a/music_assistant/server/providers/snapcast/__init__.py +++ b/music_assistant/server/providers/snapcast/__init__.py @@ -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()