@@ -212,17 +212,16 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return spec.NewError(70, "podcast with id `%s` was not found", id)
|
return spec.NewError(70, "podcast with id `%s` was not found", id)
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
return spec.NewError(70, "media type of `%s` was not found", id.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil && id.Type != specid.Podcast {
|
|
||||||
return spec.NewError(70, "media with id `%d` was not found", id.Value)
|
|
||||||
}
|
|
||||||
user := r.Context().Value(CtxUser).(*db.User)
|
user := r.Context().Value(CtxUser).(*db.User)
|
||||||
if track, ok := audioFile.(*db.Track); ok {
|
if track, ok := audioFile.(*db.Track); ok {
|
||||||
defer streamUpdateStats(c.DB, user.ID, track.Album.ID)
|
defer streamUpdateStats(c.DB, user.ID, track.Album.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
pref := streamGetTransPref(c.DB, user.ID, params.GetOr("c", ""))
|
pref := streamGetTransPref(c.DB, user.ID, params.GetOr("c", ""))
|
||||||
//
|
|
||||||
onInvalidProfile := func() error {
|
onInvalidProfile := func() error {
|
||||||
log.Printf("serving raw `%s`\n", audioFile.AudioFilename())
|
log.Printf("serving raw `%s`\n", audioFile.AudioFilename())
|
||||||
w.Header().Set("Content-Type", audioFile.MIME())
|
w.Header().Set("Content-Type", audioFile.MIME())
|
||||||
|
|||||||
Reference in New Issue
Block a user