more layout updates for mobile (#2137)
* update trakt, filler, filler editor ui * update schedules and playouts * update playout editor * update dependencies * update yaml playout editor * update path replacement editor
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using ErsatzTV.Core.Domain.Filler;
|
||||
using ErsatzTV.ViewModels;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
|
||||
namespace ErsatzTV.Validators;
|
||||
|
||||
@@ -39,4 +40,18 @@ public class FillerPresetEditViewModelValidator : AbstractValidator<FillerPreset
|
||||
.TelevisionShow or ProgramScheduleItemCollectionType.TelevisionSeason,
|
||||
() => RuleFor(fp => fp.MediaItem).NotNull());
|
||||
}
|
||||
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
ValidationResult result = await ValidateAsync(
|
||||
ValidationContext<FillerPresetEditViewModel>.CreateWithOptions(
|
||||
(FillerPresetEditViewModel)model,
|
||||
x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using ErsatzTV.ViewModels;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
|
||||
namespace ErsatzTV.Validators;
|
||||
|
||||
@@ -11,4 +12,18 @@ public class PlayoutEditViewModelValidator : AbstractValidator<PlayoutEditViewMo
|
||||
RuleFor(p => p.ProgramSchedule).NotNull().When(p => string.IsNullOrWhiteSpace(p.Kind));
|
||||
RuleFor(p => p.ExternalJsonFile).NotNull().When(p => p.Kind == PlayoutKind.ExternalJson);
|
||||
}
|
||||
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
ValidationResult result = await ValidateAsync(
|
||||
ValidationContext<PlayoutEditViewModel>.CreateWithOptions(
|
||||
(PlayoutEditViewModel)model,
|
||||
x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user