FIx: Subsonic: Don't pass container type to StreamDetails (#2061)
authorEric Munson <eric@munsonfam.org>
Tue, 25 Mar 2025 18:21:36 +0000 (14:21 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Mar 2025 18:21:36 +0000 (19:21 +0100)
This may be causing confusion when transcoding is in use on the
Subsonic server. Better to let ffmpeg detect the container type than to
give it incorrect information.

Signed-off-by: Eric B Munson <eric@munsonfam.org>
music_assistant/providers/opensubsonic/sonic_provider.py

index 8eeb6fb01951e8d68e502fa60639b984674ea484..679293772c0f48ed6d8b420c343e1f67ae208741 100644 (file)
@@ -782,10 +782,13 @@ class OpenSonicProvider(MusicProvider):
                 "Due to the streaming method used by the subsonic API, M4A files "
                 "may fail. See provider documentation for more information."
             )
-            mime_type = "?"
-        # For mp3 files, ffmpeg wants to be told 'mp3' instead of 'audio/mpeg'
-        elif mime_type.endswith("mpeg"):
-            mime_type = item.suffix
+
+        # We believe that reporting the container type here is causing playback problems and ffmpeg
+        # should be capable of guessing the correct container type for any media supported by
+        # OpenSubsonic servers. Better to let ffmpeg figure things out than tell it something
+        # confusing. We still go through the effort of figuring out what the server thinks the
+        # container is to warn about M4A files.
+        mime_type = "?"
 
         return StreamDetails(
             item_id=item.id,