diff --git a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs index a68ac84c1..4a5b4e32b 100644 --- a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs @@ -12,6 +12,7 @@ using NzbDrone.Core.ImportLists.Exceptions; using NzbDrone.Core.Indexers.Exceptions; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.Validation; namespace NzbDrone.Core.ImportLists { @@ -212,7 +213,9 @@ namespace NzbDrone.Core.ImportLists if (releases.Empty()) { - return new ValidationFailure(string.Empty, "No results were returned from your import list, please check your settings."); + return new NzbDroneValidationFailure(string.Empty, + "No results were returned from your import list, please check your settings.") + {IsWarning = true}; } } catch (RequestLimitReachedException) diff --git a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs index 194c27a79..7d70b6193 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs @@ -8,6 +8,8 @@ namespace NzbDrone.Core.ImportLists.Trakt.List public TraktListSettingsValidator() : base() { + RuleFor(c => c.Username).NotEmpty(); + RuleFor(c => c.Listname).NotEmpty(); } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs b/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs index eea675a97..8aa846746 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs @@ -3,7 +3,6 @@ using System.Text.RegularExpressions; using FluentValidation; using NzbDrone.Common.Extensions; using NzbDrone.Core.Annotations; -using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; namespace NzbDrone.Core.ImportLists.Trakt @@ -14,9 +13,20 @@ namespace NzbDrone.Core.ImportLists.Trakt public TraktSettingsBaseValidator() { RuleFor(c => c.BaseUrl).ValidRootUrl(); - RuleFor(c => c.AccessToken).NotEmpty(); - RuleFor(c => c.RefreshToken).NotEmpty(); - RuleFor(c => c.Expires).NotEmpty(); + + RuleFor(c => c.AccessToken).NotEmpty() + .OverridePropertyName("SignIn") + .WithMessage("Must authenticate with Trakt"); + + RuleFor(c => c.RefreshToken).NotEmpty() + .OverridePropertyName("SignIn") + .WithMessage("Must authenticate with Trakt") + .When(c => c.AccessToken.IsNotNullOrWhiteSpace()); + + RuleFor(c => c.Expires).NotEmpty() + .OverridePropertyName("SignIn") + .WithMessage("Must authenticate with Trakt") + .When(c => c.AccessToken.IsNotNullOrWhiteSpace() && c.RefreshToken.IsNotNullOrWhiteSpace()); // Loose validation @TODO RuleFor(c => c.Rating)