feat: add SyncAll periodic sync pipeline and wire Navidrome client into App
This commit is contained in:
@@ -47,6 +47,19 @@ func NewClient(cfg config.NavidromeConfig) (*NavidromeClient, error) {
|
||||
return &NavidromeClient{client: client}, nil
|
||||
}
|
||||
|
||||
// NewClientUnauthenticated builds a NavidromeClient without contacting the
|
||||
// server. It is intended for dependency injection in tests (where the
|
||||
// navidromeClientFactory seam in main is overridden) and for callers that want
|
||||
// to defer or skip authentication. Production wiring should prefer NewClient.
|
||||
func NewClientUnauthenticated(cfg config.NavidromeConfig) *NavidromeClient {
|
||||
return &NavidromeClient{client: &subsonic.Client{
|
||||
Client: &http.Client{Timeout: 30 * time.Second},
|
||||
BaseUrl: cfg.URL,
|
||||
User: cfg.User,
|
||||
ClientName: "naviwatcher",
|
||||
}}
|
||||
}
|
||||
|
||||
// Ping checks connectivity to the Navidrome server.
|
||||
// Returns nil if the server is reachable and responds with a valid Subsonic OK status.
|
||||
func (nc *NavidromeClient) Ping() error {
|
||||
|
||||
Reference in New Issue
Block a user