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,42 @@
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Domain.Filler;
namespace ErsatzTV.Core.Scheduling.Engine;
public interface ISchedulingEngine
{
ISchedulingEngine WithPlayoutId(int playoutId);
ISchedulingEngine WithMode(PlayoutBuildMode mode);
ISchedulingEngine WithSeed(int seed);
ISchedulingEngine WithReferenceData(PlayoutReferenceData referenceData);
ISchedulingEngine BuildBetween(DateTimeOffset start, DateTimeOffset finish);
ISchedulingEngine RemoveBefore(DateTimeOffset removeBefore);
ISchedulingEngine RestoreOrReset(Option<PlayoutAnchor> maybeAnchor);
// content definitions
Task<ISchedulingEngine> AddCollection(string key, string collectionName, PlaybackOrder playbackOrder);
Task<ISchedulingEngine> AddSearch(string key, string query, PlaybackOrder playbackOrder);
// content instructions
ISchedulingEngine AddCount(
string content,
int count,
Option<FillerKind> fillerKind,
string customTitle,
bool disableWatermarks);
// control instructions
ISchedulingEngine WaitUntil(TimeOnly waitUntil, bool tomorrow, bool rewindOnReset);
PlayoutAnchor GetAnchor();
ISchedulingEngineState GetState();
}