From 99865347e0fe04d04504a749c807e60a55ea3e75 Mon Sep 17 00:00:00 2001 From: Patrick O'Shea Date: Mon, 2 Jun 2025 20:02:26 -0500 Subject: [PATCH] fix(jukebox): jukebox mode doesn't include MusicFolder (#4067) * fix(configuration.go, mpv.go): Jukebox mode doesn't include MusicFolder in mpv command - #4066 The call to createMPVCommand is not including the MusicFolder path in mpv command causing it to fail with file not found errors. Updated default command template and createMPVCommand to use additional substitution with conf.server.MusicFolder Signed-off-by: Pat * Revert config.go change, use filepath.Join for cross platform * Update track.go with mf.AbsolutePath() --------- Signed-off-by: Pat Co-authored-by: Deluan --- conf/configuration.go | 2 +- core/playback/mpv/track.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/configuration.go b/conf/configuration.go index fafe2077b..3c6f72e8c 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -490,7 +490,7 @@ func setViperDefaults() { viper.SetDefault("ignoredarticles", "The El La Los Las Le Les Os As O A") viper.SetDefault("indexgroups", "A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ) [Unknown]([)") viper.SetDefault("ffmpegpath", "") - viper.SetDefault("mpvcmdtemplate", "mpv --audio-device=%d --no-audio-display --pause %f --input-ipc-server=%s") + viper.SetDefault("mpvcmdtemplate", "mpv --audio-device=%d --no-audio-display %f --input-ipc-server=%s") viper.SetDefault("coverartpriority", "cover.*, folder.*, front.*, embedded, external") viper.SetDefault("coverjpegquality", 75) viper.SetDefault("artistartpriority", "artist.*, album/artist.*, external") diff --git a/core/playback/mpv/track.go b/core/playback/mpv/track.go index 8a25c5029..14170efd4 100644 --- a/core/playback/mpv/track.go +++ b/core/playback/mpv/track.go @@ -34,7 +34,7 @@ func NewTrack(ctx context.Context, playbackDoneChannel chan bool, deviceName str tmpSocketName := socketName("mpv-ctrl-", ".socket") - args := createMPVCommand(deviceName, mf.Path, tmpSocketName) + args := createMPVCommand(deviceName, mf.AbsolutePath(), tmpSocketName) if len(args) == 0 { return nil, fmt.Errorf("no mpv command arguments provided") }