mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-01 19:47:37 +03:00
* Add global downsampling feature * Default to Opus & consider player transcoder * Add a test case for DefaultDownsamplingFormat Co-authored-by: Deluan <deluan@navidrome.org>
24 lines
742 B
Go
24 lines
742 B
Go
package tests
|
|
|
|
import "github.com/navidrome/navidrome/model"
|
|
|
|
type MockTranscodingRepo struct {
|
|
model.TranscodingRepository
|
|
}
|
|
|
|
func (m *MockTranscodingRepo) Get(id string) (*model.Transcoding, error) {
|
|
return &model.Transcoding{ID: id, TargetFormat: "mp3", DefaultBitRate: 160}, nil
|
|
}
|
|
|
|
func (m *MockTranscodingRepo) FindByFormat(format string) (*model.Transcoding, error) {
|
|
switch format {
|
|
case "mp3":
|
|
return &model.Transcoding{ID: "mp31", TargetFormat: "mp3", DefaultBitRate: 160}, nil
|
|
case "oga":
|
|
return &model.Transcoding{ID: "oga1", TargetFormat: "oga", DefaultBitRate: 128}, nil
|
|
case "opus":
|
|
return &model.Transcoding{ID: "opus1", TargetFormat: "opus", DefaultBitRate: 96}, nil
|
|
default:
|
|
return nil, model.ErrNotFound
|
|
}
|
|
}
|