bug(core/playback/mpv): jukebox mode under windows - navidrome#2767

Update function name

Signed-off-by: apkatsikas <apkatsikas@gmail.com>
This commit is contained in:
apkatsikas 2024-04-12 09:54:53 -04:00
parent f3b54f0a34
commit 243b5296f8
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ func NewTrack(playbackDoneChannel chan bool, deviceName string, mf model.MediaFi
return nil, err
}
tmpSocketName := utils.RandomSocketName("mpv-ctrl-", ".socket")
tmpSocketName := utils.RandomSocketOrFileName("mpv-ctrl-", ".socket")
args := createMPVCommand(mpvComdTemplate, deviceName, mf.Path, tmpSocketName)
exe, err := start(args)

View File

@ -181,7 +181,7 @@ var _ = Describe("Extractor", func() {
// Only run permission tests if we are not root
RegularUserContext("when run without root privileges", func() {
BeforeEach(func() {
accessForbiddenFile = utils.RandomSocketName("access_forbidden-", ".mp3")
accessForbiddenFile = utils.RandomSocketOrFileName("access_forbidden-", ".mp3")
f, err := os.OpenFile(accessForbiddenFile, os.O_WRONLY|os.O_CREATE, 0222)
Expect(err).ToNot(HaveOccurred())

View File

@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
)
func RandomSocketName(prefix, suffix string) string {
func RandomSocketOrFileName(prefix, suffix string) string {
socketPath := os.TempDir()
// Windows needs to use a named pipe instead of a file for the socket
// see https://mpv.io/manual/master#using-mpv-from-other-programs-or-scripts