feat: select correct transcoding for streaming

This commit is contained in:
Deluan
2020-03-16 14:28:13 -04:00
committed by Deluan Quintão
parent 39993810b3
commit c8b0d2bfae
9 changed files with 204 additions and 54 deletions
+1 -5
View File
@@ -3,7 +3,6 @@ package transcoder
import (
"testing"
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/log"
"github.com/deluan/navidrome/tests"
. "github.com/onsi/ginkgo"
@@ -18,11 +17,8 @@ func TestTranscoder(t *testing.T) {
}
var _ = Describe("createTranscodeCommand", func() {
BeforeEach(func() {
conf.Server.DownsampleCommand = "ffmpeg -i %s -b:a %bk mp3 -"
})
It("creates a valid command line", func() {
cmd, args := createTranscodeCommand("/music library/file.mp3", 123, "")
cmd, args := createTranscodeCommand("ffmpeg -i %s -b:a %bk mp3 -", "/music library/file.mp3", 123, "")
Expect(cmd).To(Equal("ffmpeg"))
Expect(args).To(Equal([]string{"-i", "/music library/file.mp3", "-b:a", "123k", "mp3", "-"}))
})