From 2ddcd323eaf519678907b0ad4e173ce88a446f1a Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 20 Dec 2025 12:54:30 +0100 Subject: [PATCH] Fix thread safety issue in Subsonic streaming (#2863) --- music_assistant/providers/opensubsonic/sonic_provider.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/music_assistant/providers/opensubsonic/sonic_provider.py b/music_assistant/providers/opensubsonic/sonic_provider.py index fad69dd6..24e1d9b1 100644 --- a/music_assistant/providers/opensubsonic/sonic_provider.py +++ b/music_assistant/providers/opensubsonic/sonic_provider.py @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio +import threading from asyncio import TaskGroup from typing import TYPE_CHECKING, Any, ParamSpec, TypeVar @@ -778,7 +779,7 @@ class OpenSonicProvider(MusicProvider): self.logger.debug("Streaming %s", streamdetails.item_id) # Use a threading event to signal cancellation to the streamer thread - cancelled = asyncio.Event() + cancelled = threading.Event() def _streamer() -> None: self.logger.debug("starting stream of item '%s'", streamdetails.item_id) -- 2.34.1