Update validation rules in ImportManualInboxCommand and ManualInboxDialog to allow season numbers starting from zero, reflecting the inclusion of special episodes and pilots. Adjust input constraints in the frontend to enhance user experience and ensure consistency with backend validation.
This commit is contained in:
@@ -37,11 +37,12 @@ public sealed class ImportManualInboxCommandValidator
|
||||
RuleFor(x => x.Items.Count).LessThanOrEqualTo(500);
|
||||
RuleFor(x => x.ShowId).NotEmpty();
|
||||
|
||||
// Ноль — законный номер: пилот часто идёт как E00, а спецвыпуски живут в нулевом сезоне.
|
||||
RuleForEach(x => x.Items)
|
||||
.Must(i => i.Season is null or (> 0 and <= 99))
|
||||
.Must(i => i.Season is null or (>= 0 and <= 99))
|
||||
.WithMessage("Сезон вне допустимого диапазона.");
|
||||
RuleForEach(x => x.Items)
|
||||
.Must(i => i.Episode is null or (> 0 and <= 999))
|
||||
.Must(i => i.Episode is null or (>= 0 and <= 999))
|
||||
.WithMessage("Номер серии вне допустимого диапазона.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user