From 75f991d670d5d557473732392408d2440917dc4e Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:21:51 -0500 Subject: [PATCH] yaml history fix (#1836) --- ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutBuilder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutBuilder.cs b/ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutBuilder.cs index 6538627b..510f6323 100644 --- a/ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutBuilder.cs +++ b/ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutBuilder.cs @@ -327,8 +327,9 @@ public class YamlPlayoutBuilder( { //logger.LogDebug("History key {Key} has {Count} items in group", key, group.Count); + // keep the most recent item from each history group that has already been played completely IEnumerable toDelete = group - .Filter(h => h.When < start.UtcDateTime) + .Filter(h => h.Finish < start.UtcDateTime) .OrderByDescending(h => h.When) .Tail();