correctly distinguish user/pass auth errors from other connectivity errors again

This commit is contained in:
Drew Weymouth
2023-11-14 17:36:07 -08:00
parent d1380d6a41
commit b7f54054d8
6 changed files with 34 additions and 10 deletions
@@ -9,9 +9,13 @@ type SubsonicServer struct {
subsonicCli.Client
}
func (s *SubsonicServer) Login(username, password string) error {
func (s *SubsonicServer) Login(username, password string) mediaprovider.LoginResponse {
s.User = username
return s.Client.Authenticate(password)
err := s.Client.Authenticate(password)
return mediaprovider.LoginResponse{
Error: err,
IsAuthError: err == subsonicCli.ErrAuthenticationFailure,
}
}
func (s *SubsonicServer) MediaProvider() mediaprovider.MediaProvider {