diff --git a/CHANGELOG.md b/CHANGELOG.md index 31476020d..1b57d22e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add *experimental* `Scripted Schedule` playout system - This system uses python scripts to support the highest degree of customization - The goal is to expose methods equivalent to all sequential schedule (YAML) instructions +- YAML and Scripted schedules: add `offline_tail` and `stop_before_end` to `pad_to_next` instruction + - Both parameters default to `true` ### Fix - Fix database operations that were slowing down playout builds diff --git a/ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs b/ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs index 43192379b..8b361af4c 100644 --- a/ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs +++ b/ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs @@ -84,6 +84,8 @@ public interface ISchedulingEngine string fallback, bool trim, int discardAttempts, + bool stopBeforeEnd, + bool offlineTail, Option maybeFillerKind, string customTitle, bool disableWatermarks); diff --git a/ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs b/ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs index 202912099..f0c1d80f4 100644 --- a/ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs +++ b/ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs @@ -465,6 +465,8 @@ public class SchedulingEngine( string fallback, bool trim, int discardAttempts, + bool stopBeforeEnd, + bool offlineTail, Option maybeFillerKind, string customTitle, bool disableWatermarks) @@ -505,10 +507,10 @@ public class SchedulingEngine( _state.CurrentTime = AddDurationInternal( targetTime, - stopBeforeEnd: true, + stopBeforeEnd, discardAttempts, trim, - offlineTail: true, + offlineTail, GetFillerKind(maybeFillerKind), customTitle, disableWatermarks, diff --git a/ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs b/ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs index f1a16dfb9..3121f0f51 100644 --- a/ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs +++ b/ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs @@ -108,6 +108,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken string fallback = null, bool trim = false, int discard_attempts = 0, + bool stop_before_end = true, + bool offline_tail = true, string filler_kind = null, string custom_title = null, bool disable_watermarks = false) @@ -124,6 +126,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken fallback, trim, discard_attempts, + stop_before_end, + offline_tail, maybeFillerKind, custom_title, disable_watermarks); diff --git a/ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs b/ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs index 88fd6e04a..42f87f3d8 100644 --- a/ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs +++ b/ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs @@ -60,10 +60,10 @@ public class YamlPlayoutPadToNextHandler(EnumeratorCache enumeratorCache) : Yaml padToNext.Content, padToNext.Fallback, targetTime, - stopBeforeEnd: true, + padToNext.StopBeforeEnd, padToNext.DiscardAttempts, padToNext.Trim, - true, + padToNext.OfflineTail, GetFillerKind(padToNext, context), padToNext.CustomTitle, padToNext.DisableWatermarks, diff --git a/ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs b/ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs index b52bf638f..4c3a799c1 100644 --- a/ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs +++ b/ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs @@ -9,8 +9,14 @@ public class YamlPlayoutPadToNextInstruction : YamlPlayoutInstruction public bool Trim { get; set; } + [YamlMember(Alias = "offline_tail", ApplyNamingConventions = false)] + public bool OfflineTail { get; set; } = true; + public string Fallback { get; set; } [YamlMember(Alias = "discard_attempts", ApplyNamingConventions = false)] public int DiscardAttempts { get; set; } + + [YamlMember(Alias = "stop_before_end", ApplyNamingConventions = false)] + public bool StopBeforeEnd { get; set; } = true; }