add all content sources to scripted schedules (#2340)
* add show content * add multi collection content * add smart collection content * add playlist content * fix infinite loop * add marathon content
This commit is contained in:
@@ -7,11 +7,19 @@ namespace ErsatzTV.Core.Scheduling.ScriptedScheduling.Modules;
|
||||
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")]
|
||||
[SuppressMessage("Usage", "VSTHRD002:Avoid problematic synchronous waits")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public class PlayoutModule(ISchedulingEngine schedulingEngine)
|
||||
{
|
||||
public int FailureCount { get; private set; }
|
||||
|
||||
// content instructions
|
||||
|
||||
public void add_count(string content, int count, string filler_kind = null, string custom_title = null, bool disable_watermarks = false)
|
||||
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))
|
||||
@@ -19,7 +27,15 @@ public class PlayoutModule(ISchedulingEngine schedulingEngine)
|
||||
maybeFillerKind = fillerKind;
|
||||
}
|
||||
|
||||
schedulingEngine.AddCount(content, count, maybeFillerKind, custom_title, disable_watermarks);
|
||||
bool success = schedulingEngine.AddCount(content, count, maybeFillerKind, custom_title, disable_watermarks);
|
||||
if (success)
|
||||
{
|
||||
FailureCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
FailureCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user