Fix #877: use XML API for Funkwhale servers since they don't implement JSON correctly
This commit is contained in:
@@ -11,7 +11,20 @@ type SubsonicServer struct {
|
|||||||
|
|
||||||
func (s *SubsonicServer) Login(username, password string) mediaprovider.LoginResponse {
|
func (s *SubsonicServer) Login(username, password string) mediaprovider.LoginResponse {
|
||||||
s.User = username
|
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{
|
return mediaprovider.LoginResponse{
|
||||||
Error: err,
|
Error: err,
|
||||||
IsAuthError: err == subsonicCli.ErrAuthenticationFailure,
|
IsAuthError: err == subsonicCli.ErrAuthenticationFailure,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require (
|
|||||||
github.com/quarckster/go-mpris-server v1.0.3
|
github.com/quarckster/go-mpris-server v1.0.3
|
||||||
github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410
|
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-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/supersonic-app/go-upnpcast v0.1.0
|
||||||
github.com/zalando/go-keyring v0.2.8
|
github.com/zalando/go-keyring v0.2.8
|
||||||
golang.org/x/net v0.50.0
|
golang.org/x/net v0.50.0
|
||||||
|
|||||||
@@ -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/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 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-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-20260405192806-29d84070230a h1:E8W3H0ZEU4ZUQSMiig+k6ZeYiNuu2El2t7JgtvrVBBc=
|
||||||
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/go.mod h1:ClhAgC2qobwH19D6kdwULLYSHlOmldDGkdu2G2Z0Ijo=
|
||||||
github.com/supersonic-app/go-upnpcast v0.1.0 h1:SL0WVgnqvAVaLT9MSRhSeVwF9pcUw1cgBITKVoWXN3g=
|
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/supersonic-app/go-upnpcast v0.1.0/go.mod h1:o/QGDTK3qdaS3h9Bt8aH5ywgbWbrPVzPCHlZYFs0IHY=
|
||||||
github.com/yuin/goldmark v1.7.16 h1:n+CJdUxaFMiDUNnWC3dMWCIQJSkxH4uz3ZwQBkAlVNE=
|
github.com/yuin/goldmark v1.7.16 h1:n+CJdUxaFMiDUNnWC3dMWCIQJSkxH4uz3ZwQBkAlVNE=
|
||||||
|
|||||||
Reference in New Issue
Block a user