mirror of https://github.com/ErsatzTV/ErsatzTV.git
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
908 B
34 lines
908 B
using ErsatzTV.Core.Scheduling.YamlScheduling.Models; |
|
using Microsoft.Extensions.Logging; |
|
|
|
namespace ErsatzTV.Core.Scheduling.YamlScheduling.Handlers; |
|
|
|
public class YamlPlayoutEpgGroupHandler : IYamlPlayoutHandler |
|
{ |
|
public bool Reset => false; |
|
|
|
public Task<bool> Handle( |
|
YamlPlayoutContext context, |
|
YamlPlayoutInstruction instruction, |
|
PlayoutBuildMode mode, |
|
ILogger<YamlPlayoutBuilder> logger, |
|
CancellationToken cancellationToken) |
|
{ |
|
if (instruction is not YamlPlayoutEpgGroupInstruction epgGroup) |
|
{ |
|
return Task.FromResult(false); |
|
} |
|
|
|
if (epgGroup.EpgGroup) |
|
{ |
|
// advance guide group by default |
|
context.LockGuideGroup(epgGroup.Advance is null or true); |
|
} |
|
else |
|
{ |
|
context.UnlockGuideGroup(); |
|
} |
|
|
|
return Task.FromResult(true); |
|
} |
|
}
|
|
|