From: Marcel van der Veldt Date: Wed, 26 Mar 2025 23:50:02 +0000 (+0100) Subject: Fix: prevent race condition in raop streaming when already stopped X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=1396422b61b9530a82ff2cf290d45f2be081f849;p=music-assistant-server.git Fix: prevent race condition in raop streaming when already stopped --- diff --git a/music_assistant/providers/airplay/raop.py b/music_assistant/providers/airplay/raop.py index 62cae6f4..cf8d0902 100644 --- a/music_assistant/providers/airplay/raop.py +++ b/music_assistant/providers/airplay/raop.py @@ -462,7 +462,7 @@ class RaopStream: async def _send_metadata(self, queue: PlayerQueue) -> None: """Send metadata to player (and connected sync childs).""" - if not queue or not queue.current_item: + if not queue or not queue.current_item or self._stopped: return duration = min(queue.current_item.duration or 0, 3600) title = queue.current_item.name @@ -490,7 +490,7 @@ class RaopStream: await self.send_cli_command(cmd) # get image - if not queue.current_item.image: + if not queue.current_item.image or self._stopped: return # the image format needs to be 500x500 jpeg for maximum compatibility with players @@ -501,7 +501,7 @@ class RaopStream: async def _send_progress(self, queue: PlayerQueue) -> None: """Send progress report to player (and connected sync childs).""" - if not queue or not queue.current_item: + if not queue or not queue.current_item or self._stopped: return progress = int(queue.corrected_elapsed_time) await self.send_cli_command(f"PROGRESS={progress}\n")