diff --git a/CHANGELOG.md b/CHANGELOG.md index 07b0f8644..85073ce55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - When ETV does not have permission, startup will fail with logged instructions on how to configure MySql - Fix scaling anamorphic content in locales that don't use period as a decimal separator (e.g. `,`) - Block schedules: fix playout build crash when empty collection uses random playback order +- Fix watermarks and graphics elements on primary content split by mid-roll filler ### Changed - **BREAKING CHANGE**: change how `Scripted Schedule` system works diff --git a/ErsatzTV.Core/Domain/PlayoutItem.cs b/ErsatzTV.Core/Domain/PlayoutItem.cs index ec0c40170..882c46e95 100644 --- a/ErsatzTV.Core/Domain/PlayoutItem.cs +++ b/ErsatzTV.Core/Domain/PlayoutItem.cs @@ -41,8 +41,24 @@ public class PlayoutItem ? new DateTimeOffset(GuideFinish.Value, TimeSpan.Zero).ToLocalTime() : null; - public PlayoutItem ForChapter(MediaChapter chapter) => - new() + public PlayoutItem ForChapter(MediaChapter chapter) + { + var watermarksCopy = new List(); + if (PlayoutItemWatermarks != null) + { + watermarksCopy.AddRange( + PlayoutItemWatermarks.Select(wm => new PlayoutItemWatermark { WatermarkId = wm.WatermarkId })); + } + + var graphicsElementsCopy = new List(); + if (PlayoutItemGraphicsElements != null) + { + graphicsElementsCopy.AddRange( + PlayoutItemGraphicsElements.Select(wm => new PlayoutItemGraphicsElement + { GraphicsElementId = wm.GraphicsElementId })); + } + + return new PlayoutItem { MediaItemId = MediaItemId, MediaItem = MediaItem, @@ -66,8 +82,10 @@ public class PlayoutItem BlockKey = BlockKey, CollectionKey = CollectionKey, CollectionEtag = CollectionEtag, - PlayoutItemWatermarks = PlayoutItemWatermarks?.ToList() + PlayoutItemWatermarks = watermarksCopy, + PlayoutItemGraphicsElements = graphicsElementsCopy }; + } public string GetDisplayDuration() {