validate filler mode pad settings (#1516)
This commit is contained in:
@@ -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/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [0.8.3-beta] - 2023-11-22
|
||||||
### Added
|
### 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");
|
Logger.LogError("Multiple pad-to-nearest-minute values are invalid; no filler will be used");
|
||||||
return new List<PlayoutItem> { playoutItem };
|
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;
|
List<MediaChapter> effectiveChapters = chapters;
|
||||||
if (allFiller.All(fp => fp.FillerKind != FillerKind.MidRoll) || effectiveChapters.Count <= 1)
|
if (allFiller.All(fp => fp.FillerKind != FillerKind.MidRoll) || effectiveChapters.Count <= 1)
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ public class FillerPresetEditViewModelValidator : AbstractValidator<FillerPreset
|
|||||||
When(
|
When(
|
||||||
fp => fp.FillerMode == FillerMode.Duration,
|
fp => fp.FillerMode == FillerMode.Duration,
|
||||||
() => RuleFor(fp => fp.Duration).NotNull());
|
() => RuleFor(fp => fp.Duration).NotNull());
|
||||||
|
When(
|
||||||
|
fp => fp.FillerMode == FillerMode.Pad,
|
||||||
|
() => RuleFor(fp => fp.PadToNearestMinute).NotNull());
|
||||||
|
|
||||||
When(
|
When(
|
||||||
fp => fp.CollectionType == ProgramScheduleItemCollectionType.Collection,
|
fp => fp.CollectionType == ProgramScheduleItemCollectionType.Collection,
|
||||||
|
|||||||
Reference in New Issue
Block a user