feat: add Spotify, management, and ZeroConf CLI flags

This commit is contained in:
Tim Van Wassenhove
2026-02-21 00:21:52 +01:00
committed by Tobias Gesellchen
parent be017440b7
commit a87783d8c6
2 changed files with 107 additions and 0 deletions
+42
View File
@@ -40,6 +40,13 @@ type Server struct {
Version string
Commit string
Date string
mgmtUsername string
mgmtPassword string
spotifyClientID string
spotifyClientSecret string
spotifyRedirectURI string
zeroconfEnabled bool
baseURL string
}
// NewServer creates a new SoundTouch service server.
@@ -215,6 +222,41 @@ func (s *Server) SetRecorder(r *proxy.Recorder) {
}
}
// SetSpotifyConfig sets the Spotify OAuth configuration.
func (s *Server) SetSpotifyConfig(clientID, clientSecret, redirectURI string) {
s.mu.Lock()
defer s.mu.Unlock()
s.spotifyClientID = clientID
s.spotifyClientSecret = clientSecret
s.spotifyRedirectURI = redirectURI
}
// SetMgmtConfig sets the management API authentication credentials.
func (s *Server) SetMgmtConfig(username, password string) {
s.mu.Lock()
defer s.mu.Unlock()
s.mgmtUsername = username
s.mgmtPassword = password
}
// SetZeroconfEnabled sets whether ZeroConf Spotify primer is enabled.
func (s *Server) SetZeroconfEnabled(enabled bool) {
s.mu.Lock()
defer s.mu.Unlock()
s.zeroconfEnabled = enabled
}
// SetBaseURL sets the external base URL for OAuth callbacks.
func (s *Server) SetBaseURL(baseURL string) {
s.mu.Lock()
defer s.mu.Unlock()
s.baseURL = baseURL
}
// GetRecordEnabled returns whether recording is enabled.
func (s *Server) GetRecordEnabled() bool {
s.mu.RLock()