replace channel active mode with is enabled and show in epg (#2256)
* add channel enabled setting * remove channel active mode
This commit is contained in:
@@ -84,9 +84,7 @@ public class IptvController : ControllerBase
|
||||
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)
|
||||
if (maybeChannel.IsNone || await maybeChannel.Map(c => c.IsEnabled).IfNoneAsync(false) == false)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
@@ -189,9 +187,7 @@ public class IptvController : ControllerBase
|
||||
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)
|
||||
if (maybeChannel.IsNone || await maybeChannel.Map(c => c.IsEnabled).IfNoneAsync(false) == false)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
@@ -78,13 +78,15 @@
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Active Mode</MudText>
|
||||
<MudText>Is Enabled</MudText>
|
||||
</div>
|
||||
<MudSelect @bind-Value="_model.ActiveMode" For="@(() => _model.ActiveMode)">
|
||||
<MudSelectItem Value="@(ChannelActiveMode.Active)">Active</MudSelectItem>
|
||||
<MudSelectItem Value="@(ChannelActiveMode.Hidden)">Hidden</MudSelectItem>
|
||||
<MudSelectItem Value="@(ChannelActiveMode.Inactive)">Inactive</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudCheckBox @bind-Value="_model.IsEnabled" Dense="true"/>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Show In EPG</MudText>
|
||||
</div>
|
||||
<MudCheckBox @bind-Value="_model.ShowInEpg" Dense="true"/>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
@@ -340,9 +342,10 @@
|
||||
_model.MusicVideoCreditsMode = channelViewModel.MusicVideoCreditsMode;
|
||||
_model.MusicVideoCreditsTemplate = channelViewModel.MusicVideoCreditsTemplate;
|
||||
_model.SongVideoMode = channelViewModel.SongVideoMode;
|
||||
_model.ActiveMode = channelViewModel.ActiveMode;
|
||||
_model.TranscodeMode = channelViewModel.TranscodeMode;
|
||||
_model.IdleBehavior = channelViewModel.IdleBehavior;
|
||||
_model.IsEnabled = channelViewModel.IsEnabled;
|
||||
_model.ShowInEpg = channelViewModel.ShowInEpg;
|
||||
},
|
||||
() => NavigationManager.NavigateTo("404"));
|
||||
}
|
||||
@@ -359,6 +362,8 @@
|
||||
_model.Group = "ErsatzTV";
|
||||
_model.FFmpegProfileId = ffmpegSettings.DefaultFFmpegProfileId;
|
||||
_model.StreamingMode = StreamingMode.TransportStreamHybrid;
|
||||
_model.IsEnabled = true;
|
||||
_model.ShowInEpg = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
private bool CanPreviewChannel(ChannelViewModel channel)
|
||||
{
|
||||
if (channel.ActiveMode is ChannelActiveMode.Inactive)
|
||||
if (!channel.IsEnabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,10 @@ public class ChannelEditViewModel
|
||||
}
|
||||
|
||||
public ChannelSongVideoMode SongVideoMode { get; set; }
|
||||
public ChannelActiveMode ActiveMode { get; set; }
|
||||
public ChannelTranscodeMode TranscodeMode { get; set; }
|
||||
public ChannelIdleBehavior IdleBehavior { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
public bool ShowInEpg { get; set; }
|
||||
|
||||
public UpdateChannel ToUpdate() =>
|
||||
new(
|
||||
@@ -64,9 +65,10 @@ public class ChannelEditViewModel
|
||||
MusicVideoCreditsMode,
|
||||
MusicVideoCreditsTemplate,
|
||||
SongVideoMode,
|
||||
ActiveMode,
|
||||
TranscodeMode,
|
||||
IdleBehavior);
|
||||
IdleBehavior,
|
||||
IsEnabled,
|
||||
ShowInEpg);
|
||||
|
||||
public CreateChannel ToCreate() =>
|
||||
new(
|
||||
@@ -91,7 +93,8 @@ public class ChannelEditViewModel
|
||||
MusicVideoCreditsMode,
|
||||
MusicVideoCreditsTemplate,
|
||||
SongVideoMode,
|
||||
ActiveMode,
|
||||
TranscodeMode,
|
||||
IdleBehavior);
|
||||
IdleBehavior,
|
||||
IsEnabled,
|
||||
ShowInEpg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user