validate filler mode pad settings (#1516)

This commit is contained in:
Jason Dove
2023-11-26 12:54:06 -06:00
committed by GitHub
parent 7586647b73
commit c6ed258021
3 changed files with 17 additions and 0 deletions
+3
View File
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- Fix playout builder crash with improperly configured pad filler preset
- Properly validate filler preset mode pad to require `filler pad to nearest minute` value
## [0.8.3-beta] - 2023-11-22
### Added
@@ -223,6 +223,17 @@ public abstract class PlayoutModeSchedulerBase<T> : IPlayoutModeScheduler<T> whe
Logger.LogError("Multiple pad-to-nearest-minute values are invalid; no filler will be used");
return new List<PlayoutItem> { playoutItem };
}
// missing pad-to-nearest-minute value is invalid; use no filler
FillerPreset invalidPadFiller = allFiller
.FirstOrDefault(f => f.FillerMode == FillerMode.Pad && f.PadToNearestMinute.HasValue == false);
if (invalidPadFiller is not null)
{
Logger.LogError(
"Pad filler ({Filler}) without pad-to-nearest-minute value is invalid; no filler will be used",
invalidPadFiller.Name);
return new List<PlayoutItem> { playoutItem };
}
List<MediaChapter> effectiveChapters = chapters;
if (allFiller.All(fp => fp.FillerKind != FillerKind.MidRoll) || effectiveChapters.Count <= 1)
@@ -21,6 +21,9 @@ public class FillerPresetEditViewModelValidator : AbstractValidator<FillerPreset
When(
fp => fp.FillerMode == FillerMode.Duration,
() => RuleFor(fp => fp.Duration).NotNull());
When(
fp => fp.FillerMode == FillerMode.Pad,
() => RuleFor(fp => fp.PadToNearestMinute).NotNull());
When(
fp => fp.CollectionType == ProgramScheduleItemCollectionType.Collection,