From 2d46b0e0fcd43022514abf0fd9e4bfaa513da46c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 22 Apr 2020 22:29:38 +0200 Subject: [PATCH] Support `raw` format in Subsonic API Some clients such as Volusonic use the `raw` format. In this case, simply return the file. --- controllers/subsonic/media_retrieval.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/subsonic/media_retrieval.py b/controllers/subsonic/media_retrieval.py index 9fdc3be..2870ff5 100644 --- a/controllers/subsonic/media_retrieval.py +++ b/controllers/subsonic/media_retrieval.py @@ -59,7 +59,9 @@ def stream(self, **kwargs): # As specified in Subsonic API: if maxBitRate is set to zero, no limit is imposed. We also # avoid any upsampling. - if fn_ext[1:] == output_format and (not maxBitRate or maxBitRate >= track.bitrate): + if output_format == "raw" or ( + fn_ext[1:] == output_format and (not maxBitRate or maxBitRate >= track.bitrate) + ): return http.send_file(track.path) Transcoder = (