mirror of https://github.com/ErsatzTV/ErsatzTV.git
10 changed files with 97 additions and 2 deletions
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
using ErsatzTV.Core.Scheduling.YamlScheduling.Models; |
||||
using Microsoft.Extensions.Logging; |
||||
|
||||
namespace ErsatzTV.Core.Scheduling.YamlScheduling.Handlers; |
||||
|
||||
public class YamlPlayoutPostRollHandler : IYamlPlayoutHandler |
||||
{ |
||||
public bool Reset => false; |
||||
|
||||
public Task<bool> Handle( |
||||
YamlPlayoutContext context, |
||||
YamlPlayoutInstruction instruction, |
||||
PlayoutBuildMode mode, |
||||
Func<string, Task> executeSequence, |
||||
ILogger<YamlPlayoutBuilder> logger, |
||||
CancellationToken cancellationToken) |
||||
{ |
||||
if (instruction is not YamlPostRollInstruction postRoll) |
||||
{ |
||||
return Task.FromResult(false); |
||||
} |
||||
|
||||
if (postRoll.PostRoll && !string.IsNullOrWhiteSpace(postRoll.Sequence)) |
||||
{ |
||||
context.SetPostRollSequence(postRoll.Sequence); |
||||
} |
||||
else |
||||
{ |
||||
context.ClearPostRollSequence(); |
||||
} |
||||
|
||||
return Task.FromResult(true); |
||||
} |
||||
} |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
using YamlDotNet.Serialization; |
||||
|
||||
namespace ErsatzTV.Core.Scheduling.YamlScheduling.Models; |
||||
|
||||
public class YamlPostRollInstruction : YamlPlayoutInstruction |
||||
{ |
||||
[YamlMember(Alias = "post_roll", ApplyNamingConventions = false)] |
||||
public bool PostRoll { get; set; } |
||||
|
||||
public string Sequence { get; set; } |
||||
} |
Loading…
Reference in new issue