Fix thread safety issue in Subsonic streaming (#2863)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 20 Dec 2025 11:54:30 +0000 (12:54 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Dec 2025 11:54:30 +0000 (12:54 +0100)
music_assistant/providers/opensubsonic/sonic_provider.py

index fad69dd6f9862f1d97fa2df17ead4e8bcdf3e52c..24e1d9b1a19aa43b5adfd3557bb462c572d9a795 100644 (file)
@@ -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)