Пример #1
0
        private ValidationFailure TestConnection()
        {
            try
            {
                _proxy.GetVersion(Settings);
            }
            catch (Exception ex)
            {
                if (ex.Message.ContainsIgnoreCase("Authentication failed"))
                {
                    return(new ValidationFailure("Username", "Authentication failed"));
                }
                _logger.ErrorException(ex.Message, ex);
                return(new ValidationFailure("Host", "Unable to connect to NZBGet"));
            }

            return(null);
        }
Пример #2
0
        private ValidationFailure TestConnection()
        {
            try
            {
                var version = _proxy.GetVersion(Settings).Split('-')[0];

                if (Version.Parse(version) < Version.Parse("12.0"))
                {
                    return(new ValidationFailure(string.Empty, "Nzbget version too low, need 12.0 or higher"));
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ContainsIgnoreCase("Authentication failed"))
                {
                    return(new ValidationFailure("Username", "Authentication failed"));
                }
                _logger.ErrorException(ex.Message, ex);
                return(new ValidationFailure("Host", "Unable to connect to NZBGet"));
            }

            return(null);
        }
Пример #3
0
 public override void Test()
 {
     _proxy.GetVersion(Settings);
 }