Files
ersatztv/ErsatzTV.Core/Scheduling/ScriptedScheduling/Modules/ContentModule.cs
T
Jason DoveandGitHub bbddd50f00 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
2025-08-24 03:11:58 +00:00

35 lines
1.0 KiB
C#

using System.Diagnostics.CodeAnalysis;
using ErsatzTV.Core.Domain;
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")]
public class ContentModule(ISchedulingEngine schedulingEngine)
{
public bool add_search(string key, string query, string order)
{
if (!Enum.TryParse(order, ignoreCase: true, out PlaybackOrder playbackOrder))
{
return false;
}
schedulingEngine.AddSearch(key, query, playbackOrder).GetAwaiter().GetResult();
return true;
}
public bool add_collection(string key, string collection, string order)
{
if (!Enum.TryParse(order, ignoreCase: true, out PlaybackOrder playbackOrder))
{
return false;
}
schedulingEngine.AddCollection(key, collection, playbackOrder).GetAwaiter().GetResult();
return true;
}
}