From f75bb25a1a61df764ebe7262ee9b10c74d5ec47b Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:38:07 -0600 Subject: [PATCH] fix building playouts with certain playlist changes (#1935) * fix building playouts with certain playlist changes * update changelog --- CHANGELOG.md | 1 + ErsatzTV.Core/Scheduling/PlaylistEnumerator.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0577df4a..d5256f207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix `Scaling Behavior` `Crop` when content is smaller than FFmpeg Profile resolution - Now, content will properly scale beyond the desired resolution before cropping - Fix displaying playout item durations that are greater than 24 hours +- Fix building playouts when playlist has been changed to have fewer items ## [0.8.8-beta] - 2024-09-19 ### Added diff --git a/ErsatzTV.Core/Scheduling/PlaylistEnumerator.cs b/ErsatzTV.Core/Scheduling/PlaylistEnumerator.cs index e72c5fb68..3dbeb6142 100644 --- a/ErsatzTV.Core/Scheduling/PlaylistEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/PlaylistEnumerator.cs @@ -195,6 +195,12 @@ public class PlaylistEnumerator : IMediaCollectionEnumerator while (result.State.Index < state.Index) { result.MoveNext(); + + // previous state is no longer valid; playlist now has fewer items + if (result.State.Index == 0) + { + break; + } } return result;