From e66b26347b0acb28e742ccdc8571edc020abc357 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:55:01 -0500 Subject: [PATCH] fix block history when using mirror offset --- CHANGELOG.md | 2 ++ ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs | 4 ++-- .../Scheduling/BlockScheduling/BlockPlayoutBuilder.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87618223b..072c2379e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix HLS Direct playback with Jellyfin 10.11 - Fix remote stream scripts (parsing issue with spaces and quotes) +- Fix block history being removed when it is still needed for mirror channel + - This caused playout build errors like "Unable to locate history for playout item" ## [25.8.0] - 2025-10-26 ### Added diff --git a/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs b/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs index ec4d86a64..f6ea6b8db 100644 --- a/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs +++ b/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs @@ -367,8 +367,8 @@ public class BuildPlayoutHandler : IRequestHandler allItemsToDelete = referenceData.PlayoutHistory .GroupBy(h => h.Key) .SelectMany(group => group - .Filter(h => h.Finish < start.UtcDateTime) + .Filter(h => h.Finish < start.UtcDateTime - referenceData.MaxPlayoutOffset) .OrderByDescending(h => h.Finish) .Tail());