Stream custom live channels using your own media
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
943 B

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);
}
}