update raw log style

This commit is contained in:
sentriz
2024-01-02 23:04:02 +00:00
parent 5bcd339501
commit 59d2bd9e82

View File

@@ -199,13 +199,13 @@ 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 {
log.Printf("serving raw file, no transcode preferences found for client %q", client)
log.Printf("serving raw file, no user transcode preferences found for client %q", client)
http.ServeFile(w, r, file.AbsPath())
return nil
}
if maxBitRate >= audioFile.AudioBitrate() {
log.Printf("serving raw file, requested max bitrate %dk is greater or equal to %dk", maxBitRate, audioFile.AudioBitrate())
log.Printf("serving raw file, requested max bitrate %d is greater or equal to %d", maxBitRate, audioFile.AudioBitrate())
http.ServeFile(w, r, file.AbsPath())
return nil
}
@@ -221,7 +221,7 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R
profile = transcode.WithSeek(profile, time.Second*time.Duration(timeOffset))
}
log.Printf("trancoding to %q with at bitrate %dk", profile.MIME(), profile.BitRate())
log.Printf("trancoding to %q with at bitrate %d", profile.MIME(), profile.BitRate())
w.Header().Set("Content-Type", profile.MIME())
if err := c.transcoder.Transcode(r.Context(), profile, file.AbsPath(), w); err != nil && !errors.Is(err, transcode.ErrFFmpegKilled) {