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/). @@ -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

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

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

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

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

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

@ -108,6 +108,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken @@ -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 @@ -124,6 +126,8 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine, CancellationToken
fallback,
trim,
discard_attempts,
stop_before_end,
offline_tail,
maybeFillerKind,
custom_title,
disable_watermarks);

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

@ -60,10 +60,10 @@ public class YamlPlayoutPadToNextHandler(EnumeratorCache enumeratorCache) : Yaml @@ -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,

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

@ -9,8 +9,14 @@ public class YamlPlayoutPadToNextInstruction : YamlPlayoutInstruction @@ -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;
}

Loading…
Cancel
Save