only discard items with random or shuffle playback order (#1309)

This commit is contained in:
Jason Dove
2023-06-19 09:17:10 -05:00
committed by GitHub
parent c148f2eb11
commit 52482ef2fb
5 changed files with 27 additions and 7 deletions
@@ -253,7 +253,7 @@ public abstract class ProgramScheduleItemCommandBase
PlaybackOrder = item.PlaybackOrder,
PlayoutDuration = FixDuration(item.PlayoutDuration.GetValueOrDefault()),
TailMode = item.TailMode,
DiscardToFillAttempts = item.DiscardToFillAttempts.GetValueOrDefault(),
DiscardToFillAttempts = FixDiscardToFillAttempts(item.PlaybackOrder, item.DiscardToFillAttempts.GetValueOrDefault()),
CustomTitle = item.CustomTitle,
GuideMode = item.GuideMode,
PreRollFillerId = item.PreRollFillerId,
@@ -277,4 +277,10 @@ public abstract class ProgramScheduleItemCommandBase
startTime.HasValue && startTime.Value >= TimeSpan.FromDays(1)
? startTime.Value.Subtract(TimeSpan.FromDays(1))
: startTime;
private static int FixDiscardToFillAttempts(PlaybackOrder playbackOrder, int value) => playbackOrder switch
{
PlaybackOrder.Random or PlaybackOrder.Shuffle => value,
_ => 0
};
}