fix transcoding typos (#573)
This fixes a typo on a log message, and another on a function name.
This commit is contained in:
@@ -194,7 +194,7 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
client, _ := params.Get("c")
|
client, _ := params.Get("c")
|
||||||
pref, err := streamGetTransodePreference(c.dbc, user.ID, client)
|
pref, err := streamGetTranscodePreference(c.dbc, user.ID, client)
|
||||||
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return spec.NewError(0, "couldn't find transcode preference: %v", err)
|
return spec.NewError(0, "couldn't find transcode preference: %v", err)
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R
|
|||||||
profile = transcode.WithSeek(profile, time.Second*time.Duration(timeOffset))
|
profile = transcode.WithSeek(profile, time.Second*time.Duration(timeOffset))
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("trancoding to %q with at bitrate %d", profile.MIME(), profile.BitRate())
|
log.Printf("transcoding to %q with at bitrate %d", profile.MIME(), profile.BitRate())
|
||||||
|
|
||||||
w.Header().Set("Content-Type", profile.MIME())
|
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) {
|
if err := c.transcoder.Transcode(r.Context(), profile, file.AbsPath(), w); err != nil && !errors.Is(err, transcode.ErrFFmpegKilled) {
|
||||||
@@ -252,7 +252,7 @@ func (c *Controller) ServeGetAvatar(w http.ResponseWriter, r *http.Request) *spe
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func streamGetTransodePreference(dbc *db.DB, userID int, client string) (*db.TranscodePreference, error) {
|
func streamGetTranscodePreference(dbc *db.DB, userID int, client string) (*db.TranscodePreference, error) {
|
||||||
var pref db.TranscodePreference
|
var pref db.TranscodePreference
|
||||||
err := dbc.
|
err := dbc.
|
||||||
Where("user_id=?", userID).
|
Where("user_id=?", userID).
|
||||||
@@ -270,7 +270,7 @@ func streamGetTransodePreference(dbc *db.DB, userID int, client string) (*db.Tra
|
|||||||
}
|
}
|
||||||
|
|
||||||
func streamGetTranscodeMeta(dbc *db.DB, userID int, client string) spec.TranscodeMeta {
|
func streamGetTranscodeMeta(dbc *db.DB, userID int, client string) spec.TranscodeMeta {
|
||||||
pref, _ := streamGetTransodePreference(dbc, userID, client)
|
pref, _ := streamGetTranscodePreference(dbc, userID, client)
|
||||||
if pref == nil {
|
if pref == nil {
|
||||||
return spec.TranscodeMeta{}
|
return spec.TranscodeMeta{}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user