mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
New: Add pushsafer notification service (#8770)
This commit is contained in:
committed by
GitHub
parent
3055ed5336
commit
f38077aac7
@@ -73,5 +73,18 @@ namespace NzbDrone.Core.Validation
|
||||
ruleBuilder.SetValidator(new NotEmptyValidator(null));
|
||||
return ruleBuilder.SetValidator(new RegularExpressionValidator("radarr", RegexOptions.IgnoreCase)).WithMessage("Must contain Radarr");
|
||||
}
|
||||
|
||||
public static IRuleBuilderOptions<T, string> ValidParsedStringRange<T>(this IRuleBuilder<T, string> ruleBuilder, int minValue, int maxValue)
|
||||
{
|
||||
return ruleBuilder.Must(x =>
|
||||
{
|
||||
if (int.TryParse(x, out var value))
|
||||
{
|
||||
return value >= minValue && value <= maxValue;
|
||||
}
|
||||
|
||||
return false;
|
||||
}).WithMessage($"Must be greater than or equal to '{minValue}' and less than or equal to '{maxValue}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user