Browse Source

add stop_before_end and offline_tail to pad_to_next (#2359)

pull/2360/head
Jason Dove 11 months ago committed by GitHub
parent
commit
eadacc7f8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 2
      ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs
  3. 6
      ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs
  4. 4
      ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs
  5. 4
      ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs
  6. 6
      ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs

2
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 - Add *experimental* `Scripted Schedule` playout system
- This system uses python scripts to support the highest degree of customization - 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 - 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
- Fix database operations that were slowing down playout builds - Fix database operations that were slowing down playout builds

2
ErsatzTV.Core/Scheduling/Engine/ISchedulingEngine.cs

@ -84,6 +84,8 @@ public interface ISchedulingEngine
string fallback, string fallback,
bool trim, bool trim,
int discardAttempts, int discardAttempts,
bool stopBeforeEnd,
bool offlineTail,
Option<FillerKind> maybeFillerKind, Option<FillerKind> maybeFillerKind,
string customTitle, string customTitle,
bool disableWatermarks); bool disableWatermarks);

6
ErsatzTV.Core/Scheduling/Engine/SchedulingEngine.cs

@ -465,6 +465,8 @@ public class SchedulingEngine(
string fallback, string fallback,
bool trim, bool trim,
int discardAttempts, int discardAttempts,
bool stopBeforeEnd,
bool offlineTail,
Option<FillerKind> maybeFillerKind, Option<FillerKind> maybeFillerKind,
string customTitle, string customTitle,
bool disableWatermarks) bool disableWatermarks)
@ -505,10 +507,10 @@ public class SchedulingEngine(
_state.CurrentTime = AddDurationInternal( _state.CurrentTime = AddDurationInternal(
targetTime, targetTime,
stopBeforeEnd: true, stopBeforeEnd,
discardAttempts, discardAttempts,
trim, trim,
offlineTail: true, offlineTail,
GetFillerKind(maybeFillerKind), GetFillerKind(maybeFillerKind),
customTitle, customTitle,
disableWatermarks, disableWatermarks,

4
ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/PlayoutModule.cs

@ -108,6 +108,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken
string fallback = null, string fallback = null,
bool trim = false, bool trim = false,
int discard_attempts = 0, int discard_attempts = 0,
bool stop_before_end = true,
bool offline_tail = true,
string filler_kind = null, string filler_kind = null,
string custom_title = null, string custom_title = null,
bool disable_watermarks = false) bool disable_watermarks = false)
@ -124,6 +126,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken
fallback, fallback,
trim, trim,
discard_attempts, discard_attempts,
stop_before_end,
offline_tail,
maybeFillerKind, maybeFillerKind,
custom_title, custom_title,
disable_watermarks); disable_watermarks);

4
ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutPadToNextHandler.cs

@ -60,10 +60,10 @@ public class YamlPlayoutPadToNextHandler(EnumeratorCache enumeratorCache) : Yaml
padToNext.Content, padToNext.Content,
padToNext.Fallback, padToNext.Fallback,
targetTime, targetTime,
stopBeforeEnd: true, padToNext.StopBeforeEnd,
padToNext.DiscardAttempts, padToNext.DiscardAttempts,
padToNext.Trim, padToNext.Trim,
true, padToNext.OfflineTail,
GetFillerKind(padToNext, context), GetFillerKind(padToNext, context),
padToNext.CustomTitle, padToNext.CustomTitle,
padToNext.DisableWatermarks, padToNext.DisableWatermarks,

6
ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutPadToNextInstruction.cs

@ -9,8 +9,14 @@ public class YamlPlayoutPadToNextInstruction : YamlPlayoutInstruction
public bool Trim { get; set; } public bool Trim { get; set; }
[YamlMember(Alias = "offline_tail", ApplyNamingConventions = false)]
public bool OfflineTail { get; set; } = true;
public string Fallback { get; set; } public string Fallback { get; set; }
[YamlMember(Alias = "discard_attempts", ApplyNamingConventions = false)] [YamlMember(Alias = "discard_attempts", ApplyNamingConventions = false)]
public int DiscardAttempts { get; set; } public int DiscardAttempts { get; set; }
[YamlMember(Alias = "stop_before_end", ApplyNamingConventions = false)]
public bool StopBeforeEnd { get; set; } = true;
} }

Loading…
Cancel
Save