Initial support for song browsing from UI

This commit is contained in:
Deluan
2020-01-22 10:19:13 -05:00
parent fdf1ceeade
commit 9557f7ceed
17 changed files with 158 additions and 28 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package subsonic
import (
"net/http"
"strconv"
"github.com/cloudsonic/sonic-server/engine"
"github.com/cloudsonic/sonic-server/log"
@@ -54,7 +55,7 @@ func (c *StreamController) Stream(w http.ResponseWriter, r *http.Request) (*resp
// contentLength = strconv.Itoa((mf.Duration + 1) * maxBitRate * 1000 / 8)
//}
h := w.Header()
h.Set("Content-Length", mf.Size)
h.Set("Content-Length", strconv.Itoa(mf.Size))
h.Set("Content-Type", "audio/mpeg")
h.Set("Expires", "0")
h.Set("Cache-Control", "must-revalidate")