From: Marcel van der Veldt Date: Sat, 15 Mar 2025 16:50:22 +0000 (+0100) Subject: Fix: Ignore keyerror when setting default stream X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=24fee2519a4438fbeea1c503172f88bfb90e70b4;p=music-assistant-server.git Fix: Ignore keyerror when setting default stream --- 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}"