add channel active mode (#2083)

This commit is contained in:
Jason Dove
2025-06-27 21:19:26 +00:00
committed by GitHub
parent 27c701b936
commit 583cbf7b14
24 changed files with 11774 additions and 17 deletions
+12 -2
View File
@@ -83,10 +83,15 @@ public class IptvController : ControllerBase
[FromQuery]
string mode = null)
{
Option<ChannelViewModel> maybeChannel = await _mediator.Send(new GetChannelByNumber(channelNumber));
if (maybeChannel.IsNone || await maybeChannel.Map(c => c.ActiveMode).IfNoneAsync(ChannelActiveMode.Inactive) is ChannelActiveMode.Inactive)
{
return NotFound();
}
// if mode is "unspecified" - find the configured mode and set it or redirect
if (string.IsNullOrWhiteSpace(mode) || mode == "mixed")
{
Option<ChannelViewModel> maybeChannel = await _mediator.Send(new GetChannelByNumber(channelNumber));
foreach (ChannelViewModel channel in maybeChannel)
{
switch (channel.StreamingMode)
@@ -180,10 +185,15 @@ public class IptvController : ControllerBase
[FromQuery]
string mode = "mixed")
{
Option<ChannelViewModel> maybeChannel = await _mediator.Send(new GetChannelByNumber(channelNumber));
if (maybeChannel.IsNone || await maybeChannel.Map(c => c.ActiveMode).IfNoneAsync(ChannelActiveMode.Inactive) is ChannelActiveMode.Inactive)
{
return NotFound();
}
// if mode is "unspecified" - find the configured mode and set it or redirect
if (string.IsNullOrWhiteSpace(mode) || mode == "mixed")
{
Option<ChannelViewModel> maybeChannel = await _mediator.Send(new GetChannelByNumber(channelNumber));
foreach (ChannelViewModel channel in maybeChannel)
{
switch (channel.StreamingMode)