Fix #877: use XML API for Funkwhale servers since they don't implement JSON correctly

This commit is contained in:
Drew Weymouth
2026-04-05 13:11:57 -07:00
parent 6aa53d6cfe
commit 8636e54c3a
3 changed files with 17 additions and 4 deletions
@@ -11,7 +11,20 @@ type SubsonicServer struct {
func (s *SubsonicServer) Login(username, password string) mediaprovider.LoginResponse {
s.User = username
err := s.Client.Authenticate(password)
pr, err := s.Client.Ping()
if err != nil {
return mediaprovider.LoginResponse{
Error: err,
IsAuthError: err == subsonicCli.ErrAuthenticationFailure,
}
}
if pr.Type == "funkwhale" {
// Funkwhale doesn't use correct types for IDs in the JSON response
// and shows no progress in fixing this, so use the XML API
s.Client.UseJSON = false
}
err = s.Client.Authenticate(password)
return mediaprovider.LoginResponse{
Error: err,
IsAuthError: err == subsonicCli.ErrAuthenticationFailure,