feat: add SyncAll periodic sync pipeline and wire Navidrome client into App

This commit is contained in:
2026-07-19 22:22:46 +03:00
parent 40c4240693
commit dc4bdcdab0
9 changed files with 417 additions and 4 deletions

View File

@@ -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 {