From 20cdd38fc4dd9a87172758a6aa090c8d3f501c3f Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 25 Nov 2021 15:48:32 -0500 Subject: [PATCH] Better logging for agents configuration --- conf/configuration.go | 1 + core/agents/agents.go | 5 ++++- server/initial_setup.go | 26 +++++++++++++++++--------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/conf/configuration.go b/conf/configuration.go index c4f9ba61c71..d6e49262e22 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -158,6 +158,7 @@ func disableExternalServices() { Server.LastFM.Enabled = false Server.Spotify.ID = "" Server.ListenBrainz.Enabled = false + Server.Agents = "" if Server.UILoginBackgroundURL == consts.DefaultUILoginBackgroundURL { Server.UILoginBackgroundURL = consts.DefaultUILoginBackgroundURLOffline } diff --git a/core/agents/agents.go b/core/agents/agents.go index 78ed24ca50c..edf168e68ce 100644 --- a/core/agents/agents.go +++ b/core/agents/agents.go @@ -18,7 +18,10 @@ type Agents struct { } func New(ds model.DataStore) *Agents { - order := strings.Split(conf.Server.Agents, ",") + var order []string + if conf.Server.Agents != "" { + order = strings.Split(conf.Server.Agents, ",") + } order = append(order, PlaceholderAgentName) var res []Interface for _, name := range order { diff --git a/server/initial_setup.go b/server/initial_setup.go index 0832099fdf2..3718c2556d1 100644 --- a/server/initial_setup.go +++ b/server/initial_setup.go @@ -90,15 +90,23 @@ func checkFfmpegInstallation() { } func checkExternalCredentials() { - if !conf.Server.LastFM.Enabled { - log.Info("Last.FM integration is DISABLED") - } else { - log.Debug("Last.FM integration is ENABLED") - } + if conf.Server.EnableExternalServices { + if !conf.Server.LastFM.Enabled { + log.Info("Last.FM integration is DISABLED") + } else { + log.Debug("Last.FM integration is ENABLED") + } - if conf.Server.Spotify.ID == "" || conf.Server.Spotify.Secret == "" { - log.Info("Spotify integration is not enabled: missing ID/Secret") - } else { - log.Debug("Spotify integration is ENABLED") + if !conf.Server.ListenBrainz.Enabled { + log.Info("ListenBrainz integration is DISABLED") + } else { + log.Debug("ListenBrainz integration is ENABLED") + } + + if conf.Server.Spotify.ID == "" || conf.Server.Spotify.Secret == "" { + log.Info("Spotify integration is not enabled: missing ID/Secret") + } else { + log.Debug("Spotify integration is ENABLED") + } } }