From 88e58c055a2b1259d0c68618b943b4a319855b15 Mon Sep 17 00:00:00 2001 From: sentriz Date: Fri, 1 Mar 2024 18:16:54 +0000 Subject: [PATCH] feat(subsonic): return an error if maxBitRate requested with no user transcode preferences set --- server/ctrlsubsonic/handlers_raw.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/ctrlsubsonic/handlers_raw.go b/server/ctrlsubsonic/handlers_raw.go index de3f16a5..a941cec3 100644 --- a/server/ctrlsubsonic/handlers_raw.go +++ b/server/ctrlsubsonic/handlers_raw.go @@ -199,6 +199,9 @@ 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) + } 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()) return nil