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,
+1 -1
View File
@@ -22,7 +22,7 @@ require (
github.com/quarckster/go-mpris-server v1.0.3
github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410
github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449
github.com/supersonic-app/go-subsonic v0.0.0-20260311143343-43acfbb184d2
github.com/supersonic-app/go-subsonic v0.0.0-20260405192806-29d84070230a
github.com/supersonic-app/go-upnpcast v0.1.0
github.com/zalando/go-keyring v0.2.8
golang.org/x/net v0.50.0
+2 -2
View File
@@ -123,8 +123,8 @@ github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410 h1:wuDH
github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410/go.mod h1:XvGBPgXWkKrK+5OsoVkTcTZmwZac1Sj6miEn8q6uA20=
github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449 h1:UHIPI43VzyWuIF8z8WVMdjMsC/orZTZQJraD/Iv+ghw=
github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0=
github.com/supersonic-app/go-subsonic v0.0.0-20260311143343-43acfbb184d2 h1:VtrqvDwb44RSErifxchVKYdCf62/cO2Cumyz+uPlqkI=
github.com/supersonic-app/go-subsonic v0.0.0-20260311143343-43acfbb184d2/go.mod h1:ClhAgC2qobwH19D6kdwULLYSHlOmldDGkdu2G2Z0Ijo=
github.com/supersonic-app/go-subsonic v0.0.0-20260405192806-29d84070230a h1:E8W3H0ZEU4ZUQSMiig+k6ZeYiNuu2El2t7JgtvrVBBc=
github.com/supersonic-app/go-subsonic v0.0.0-20260405192806-29d84070230a/go.mod h1:ClhAgC2qobwH19D6kdwULLYSHlOmldDGkdu2G2Z0Ijo=
github.com/supersonic-app/go-upnpcast v0.1.0 h1:SL0WVgnqvAVaLT9MSRhSeVwF9pcUw1cgBITKVoWXN3g=
github.com/supersonic-app/go-upnpcast v0.1.0/go.mod h1:o/QGDTK3qdaS3h9Bt8aH5ywgbWbrPVzPCHlZYFs0IHY=
github.com/yuin/goldmark v1.7.16 h1:n+CJdUxaFMiDUNnWC3dMWCIQJSkxH4uz3ZwQBkAlVNE=