From 222fccf80691e7e523c0a19c80f703f9a8426447 Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 20 Feb 2025 22:24:09 -0500 Subject: [PATCH] feat(server): new option to set the default for ReportRealPath on new players Implements #3653 Signed-off-by: Deluan --- conf/configuration.go | 2 ++ core/players.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/conf/configuration.go b/conf/configuration.go index b1d476d9c..247c266e2 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -62,6 +62,7 @@ type configOptions struct { IgnoredArticles string IndexGroups string SubsonicArtistParticipations bool + DefaultReportRealPath bool FFmpegPath string MPVPath string MPVCmdTemplate string @@ -459,6 +460,7 @@ func init() { 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("subsonicartistparticipations", false) + viper.SetDefault("defaultreportrealpath", false) viper.SetDefault("ffmpegpath", "") viper.SetDefault("mpvcmdtemplate", "mpv --audio-device=%d --no-audio-display --pause %f --input-ipc-server=%s") diff --git a/core/players.go b/core/players.go index 878136fd4..1cba4893b 100644 --- a/core/players.go +++ b/core/players.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + "github.com/navidrome/navidrome/conf" "github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" @@ -52,6 +53,7 @@ func (p *players) Register(ctx context.Context, playerID, client, userAgent, ip UserId: user.ID, Client: client, ScrobbleEnabled: true, + ReportRealPath: conf.Server.DefaultReportRealPath, } log.Info(ctx, "Registering new player", "id", plr.ID, "client", client, "username", username, "type", userAgent) }