fix: add 'opus' to the container aliases for improved direct play detection
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -10,7 +10,7 @@ var containerAliasGroups = func() map[string]string {
|
|||||||
groups := [][]string{
|
groups := [][]string{
|
||||||
{"aac", "adts", "m4a", "mp4", "m4b", "m4p"},
|
{"aac", "adts", "m4a", "mp4", "m4b", "m4p"},
|
||||||
{"mpeg", "mp3", "mp2"},
|
{"mpeg", "mp3", "mp2"},
|
||||||
{"ogg", "oga"},
|
{"ogg", "oga", "opus"},
|
||||||
{"aif", "aiff"},
|
{"aif", "aiff"},
|
||||||
{"asf", "wma"},
|
{"asf", "wma"},
|
||||||
{"mpc", "mpp"},
|
{"mpc", "mpp"},
|
||||||
|
|||||||
@@ -129,6 +129,18 @@ var _ = Describe("Decider", func() {
|
|||||||
Expect(decision.CanDirectPlay).To(BeTrue())
|
Expect(decision.CanDirectPlay).To(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("handles container aliases (opus -> ogg)", func() {
|
||||||
|
mf := withProbe(&model.MediaFile{ID: "1", Suffix: "opus", Codec: "Opus", BitRate: 165, Channels: 2, SampleRate: 48000})
|
||||||
|
ci := &ClientInfo{
|
||||||
|
DirectPlayProfiles: []DirectPlayProfile{
|
||||||
|
{Containers: []string{"ogg"}, AudioCodecs: []string{"opus"}, Protocols: []string{ProtocolHTTP}},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
decision, err := svc.MakeDecision(ctx, mf, ci, DecisionOptions{})
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
Expect(decision.CanDirectPlay).To(BeTrue())
|
||||||
|
})
|
||||||
|
|
||||||
It("handles codec aliases (adts -> aac)", func() {
|
It("handles codec aliases (adts -> aac)", func() {
|
||||||
mf := withProbe(&model.MediaFile{ID: "1", Suffix: "m4a", Codec: "AAC", BitRate: 256, Channels: 2})
|
mf := withProbe(&model.MediaFile{ID: "1", Suffix: "m4a", Codec: "AAC", BitRate: 256, Channels: 2})
|
||||||
ci := &ClientInfo{
|
ci := &ClientInfo{
|
||||||
|
|||||||
Reference in New Issue
Block a user