Skip to content

Commit

Permalink
feat(subsonic): return an error if maxBitRate requested with no user …
Browse files Browse the repository at this point in the history
…transcode preferences set
  • Loading branch information
sentriz committed Mar 1, 2024
1 parent 0260608 commit 88e58c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/ctrlsubsonic/handlers_raw.go
Expand Up @@ -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
Expand Down

0 comments on commit 88e58c0

Please sign in to comment.