mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
indexer specific setting validation
This commit is contained in:
parent
227e13d858
commit
e4fc0c57b3
11 changed files with 93 additions and 26 deletions
|
@ -1,4 +1,5 @@
|
|||
using FluentValidation;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Validators;
|
||||
|
||||
namespace NzbDrone.Api.Validation
|
||||
|
@ -14,5 +15,10 @@ namespace NzbDrone.Api.Validation
|
|||
{
|
||||
return ruleBuilder.SetValidator(new EqualValidator(0));
|
||||
}
|
||||
|
||||
public static IRuleBuilderOptions<T, string> HaveHttpProtocol<T>(this IRuleBuilder<T, string> ruleBuilder)
|
||||
{
|
||||
return ruleBuilder.SetValidator(new RegularExpressionValidator("^http(s)?://", RegexOptions.IgnoreCase)).WithMessage("must start with http:// or https://");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue