From 48b1aa3e643e4346bf9605277e590a6cbda5a958 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:53:06 -0600 Subject: [PATCH] fix block playout build bug (#2642) --- .../BlockScheduling/BlockPlayoutFillerBuilder.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ErsatzTV.Core/Scheduling/BlockScheduling/BlockPlayoutFillerBuilder.cs b/ErsatzTV.Core/Scheduling/BlockScheduling/BlockPlayoutFillerBuilder.cs index 6ac71e283..1f1773f38 100644 --- a/ErsatzTV.Core/Scheduling/BlockScheduling/BlockPlayoutFillerBuilder.cs +++ b/ErsatzTV.Core/Scheduling/BlockScheduling/BlockPlayoutFillerBuilder.cs @@ -65,12 +65,16 @@ public class BlockPlayoutFillerBuilder( var collectionEnumerators = new Dictionary(); + // history doesn't have an equivalent to "remove before" + // so for break content, let's remove all corresponding items that should be removed + var itemsForBreakContent = allItems.Where(x => x.FinishOffset >= removeBefore).ToList(); + var breakContentResult = await AddBreakContent( playout, referenceData, mode, collectionEnumerators, - allItems, + itemsForBreakContent, filteredExistingHistory, result.AddedHistory, cancellationToken); @@ -92,12 +96,16 @@ public class BlockPlayoutFillerBuilder( .ToList(); allItems.AddRange(result.AddedItems); + // history doesn't have an equivalent to "remove before" + // so for break content, let's remove all corresponding items that should be removed + itemsForBreakContent = allItems.Where(x => x.FinishOffset >= removeBefore).ToList(); + result = await AddDefaultFiller( playout, referenceData, result, collectionEnumerators, - allItems, + itemsForBreakContent, filteredExistingHistory, cancellationToken);