From 81f8a7ec49cc1fe66fdad2b1b80ff646ca2a1040 Mon Sep 17 00:00:00 2001 From: sentriz Date: Wed, 20 Mar 2024 21:02:32 +0000 Subject: [PATCH] fix(subsonic): allow unlimited bitrate with no transcode setting configured fixes #485 Release-As: 0.16.4 --- server/ctrlsubsonic/handlers_raw.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/ctrlsubsonic/handlers_raw.go b/server/ctrlsubsonic/handlers_raw.go index a941cec3..d050ebe4 100644 --- a/server/ctrlsubsonic/handlers_raw.go +++ b/server/ctrlsubsonic/handlers_raw.go @@ -199,8 +199,8 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R return spec.NewError(0, "couldn't find transcode preference: %v", err) } if pref == nil { - if maxBitRate > 0 { - return spec.NewError(0, "maxBitRate requested and no user transcode preferences found for user %q and client %q", user.Name, client) + if maxBitRate > 0 && maxBitRate < audioFile.AudioBitrate() { + return spec.NewError(0, "param maxBitRate requested and no user transcode preferences found for user %q and client %q. please configure transcode settings if you want to transcode", user.Name, client) } log.Printf("serving raw file, no user transcode preferences found for user %q and client %q", user.Name, client) http.ServeFile(w, r, file.AbsPath())