Unexport SocketName, use socketName in NewTrack

This commit is contained in:
apkatsikas 2024-04-14 13:16:19 -04:00
parent e8a60428b7
commit 36568dc479
3 changed files with 3 additions and 4 deletions

View File

@ -4,6 +4,6 @@ package mpv
import "github.com/navidrome/navidrome/utils"
func SocketName(prefix, suffix string) string {
func socketName(prefix, suffix string) string {
return utils.TempFileName(prefix, suffix)
}

View File

@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
)
func SocketName(prefix, suffix string) string {
func socketName(prefix, suffix string) string {
// Windows needs to use a named pipe for the socket
// see https://mpv.io/manual/master#using-mpv-from-other-programs-or-scripts
return filepath.Join(`\\.\pipe\mpvsocket`, prefix+uuid.NewString()+suffix)

View File

@ -13,7 +13,6 @@ import (
"github.com/dexterlb/mpvipc"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/utils"
)
type MpvTrack struct {
@ -32,7 +31,7 @@ func NewTrack(playbackDoneChannel chan bool, deviceName string, mf model.MediaFi
return nil, err
}
tmpSocketName := utils.TempFileName("mpv-ctrl-", ".socket")
tmpSocketName := socketName("mpv-ctrl-", ".socket")
args := createMPVCommand(mpvComdTemplate, deviceName, mf.Path, tmpSocketName)
exe, err := start(args)