add param parsing methods

related: #41
This commit is contained in:
sentriz
2020-04-25 17:37:54 +01:00
committed by Senan Kelly
parent 07e1c53d69
commit 4f519d71ed
5 changed files with 296 additions and 54 deletions

View File

@@ -79,7 +79,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
Find(&childTracks)
for _, c := range childTracks {
toAppend := spec.NewTCTrackByFolder(c, folder)
if params.Get("c") == "Jamstash" {
if v, _ := params.Get("c"); v == "Jamstash" {
// jamstash thinks it can't play flacs
toAppend.ContentType = "audio/mpeg"
toAppend.Suffix = "mp3"