1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Updated: TMDbSettings.cs to allow pipe for or for genre ids (#2389)

This commit is contained in:
crhammock 2018-01-11 16:06:26 +00:00 committed by Leonardo Galli
parent 663ac972cd
commit da425b04b1

View File

@ -36,19 +36,19 @@ public TMDbSettingsValidator()
RuleFor(c => c.Ceritification)
.Matches(@"^\bNR\b|\bG\b|\bPG\b|\bPG\-13\b|\bR\b|\bNC\-17\b$", RegexOptions.IgnoreCase)
.When(c => c.Ceritification.IsNotNullOrWhiteSpace())
.WithMessage("Not a valid cerification");
.WithMessage("Not a valid certification");
// CSV of numbers
RuleFor(c => c.IncludeGenreIds)
.Matches(@"^\d+([,]\d+)*$", RegexOptions.IgnoreCase)
.Matches(@"^\d+([,|]\d+)*$", RegexOptions.IgnoreCase)
.When(c => c.IncludeGenreIds.IsNotNullOrWhiteSpace())
.WithMessage("Genre Ids must be comma separated number ids");
.WithMessage("Genre Ids must be comma (,) or pipe (|) separated number ids");
// CSV of numbers
RuleFor(c => c.ExcludeGenreIds)
.Matches(@"^\d+([,]\d+)*$", RegexOptions.IgnoreCase)
.Matches(@"^\d+([,|]\d+)*$", RegexOptions.IgnoreCase)
.When(c => c.ExcludeGenreIds.IsNotNullOrWhiteSpace())
.WithMessage("Genre Ids must be comma separated number ids");
.WithMessage("Genre Ids must be comma (,) or pipe (|) separated number ids");
}
}