add new scheduling engine, basic scripted schedule system (#2337)

* start to add content to scheduling engine

* add first content instruction

* add search content

* allow scripted schedule creation

* don't use scheduling engine in sequential playout builder, yet
This commit is contained in:
Jason Dove
2025-08-24 03:11:58 +00:00
committed by GitHub
parent 53f281ce32
commit bbddd50f00
11 changed files with 902 additions and 34 deletions
@@ -0,0 +1,35 @@
using System.Diagnostics.CodeAnalysis;
using ErsatzTV.Core.Domain.Filler;
using ErsatzTV.Core.Scheduling.Engine;
namespace ErsatzTV.Core.Scheduling.ScriptedScheduling.Modules;
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")]
[SuppressMessage("Usage", "VSTHRD002:Avoid problematic synchronous waits")]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class PlayoutModule(ISchedulingEngine schedulingEngine)
{
// content instructions
public void add_count(string content, int count, string filler_kind = null, string custom_title = null, bool disable_watermarks = false)
{
Option<FillerKind> maybeFillerKind = Option<FillerKind>.None;
if (Enum.TryParse(filler_kind, ignoreCase: true, out FillerKind fillerKind))
{
maybeFillerKind = fillerKind;
}
schedulingEngine.AddCount(content, count, maybeFillerKind, custom_title, disable_watermarks);
}
// control instructions
public void wait_until(string when, bool tomorrow = false, bool rewind_on_reset = false)
{
if (TimeOnly.TryParse(when, out TimeOnly waitUntil))
{
schedulingEngine.WaitUntil(waitUntil, tomorrow, rewind_on_reset);
}
}
}