From 24fee2519a4438fbeea1c503172f88bfb90e70b4 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 15 Mar 2025 17:50:22 +0100 Subject: [PATCH] Fix: Ignore keyerror when setting default stream --- music_assistant/providers/snapcast/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/music_assistant/providers/snapcast/__init__.py b/music_assistant/providers/snapcast/__init__.py index 0d513d20..904eaacc 100644 --- a/music_assistant/providers/snapcast/__init__.py +++ b/music_assistant/providers/snapcast/__init__.py @@ -471,8 +471,9 @@ class SnapCastProvider(PlayerProvider): # and assigns the default stream to the player # we do this delayed so we can reuse the stream if a new play command is issued async def clear_stream(): - await self._get_snapgroup(player_id).set_stream("default") - await self._delete_current_snapstream(self._get_snapstream(player_id)) + with suppress(KeyError): + await self._get_snapgroup(player_id).set_stream("default") + await self._delete_current_snapstream(self._get_snapstream(player_id)) self.mass.call_later( 30, self.mass.create_task, clear_stream, task_id=f"snapcast_clear_stream_{player_id}" -- 2.34.1