Skip to content

Commit

Permalink
Better logging for agents configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Nov 25, 2021
1 parent 913a4cf commit 20cdd38
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 4 additions & 1 deletion core/agents/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 17 additions & 9 deletions server/initial_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}

0 comments on commit 20cdd38

Please sign in to comment.