fix yaml guid validation (#2257)
This commit is contained in:
@@ -91,7 +91,7 @@ public class CreateChannelHandler(
|
||||
TranscodeMode = request.TranscodeMode,
|
||||
IdleBehavior = request.IdleBehavior,
|
||||
IsEnabled = request.IsEnabled,
|
||||
ShowInEpg = request.ShowInEpg
|
||||
ShowInEpg = request.IsEnabled && request.ShowInEpg
|
||||
};
|
||||
|
||||
foreach (int id in watermarkId)
|
||||
|
||||
@@ -46,7 +46,7 @@ public class UpdateChannelHandler(
|
||||
c.TranscodeMode = update.TranscodeMode;
|
||||
c.IdleBehavior = update.IdleBehavior;
|
||||
c.IsEnabled = update.IsEnabled;
|
||||
c.ShowInEpg = update.ShowInEpg;
|
||||
c.ShowInEpg = update.IsEnabled && update.ShowInEpg;
|
||||
c.Artwork ??= [];
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(update.Logo?.Path))
|
||||
|
||||
@@ -80,13 +80,13 @@
|
||||
<div class="d-flex">
|
||||
<MudText>Is Enabled</MudText>
|
||||
</div>
|
||||
<MudCheckBox @bind-Value="_model.IsEnabled" Dense="true"/>
|
||||
<MudCheckBox @bind-Value="_model.IsEnabled" For="@(() => _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"/>
|
||||
<MudCheckBox @bind-Value="_model.ShowInEpg" For="@(() => _model.ShowInEpg)" Dense="true"/>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"value": { "type": "string" }
|
||||
"value": { "type": ["integer", "string"] }
|
||||
},
|
||||
"required": [ "source", "value" ],
|
||||
"additionalProperties": false
|
||||
@@ -154,7 +154,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"value": { "type": "string" }
|
||||
"value": { "type": ["integer", "string"] }
|
||||
},
|
||||
"required": [ "source", "value" ],
|
||||
"additionalProperties": false
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"value": { "type": "string" }
|
||||
"value": { "type": ["integer", "string"] }
|
||||
},
|
||||
"required": [ "source", "value" ],
|
||||
"additionalProperties": false
|
||||
@@ -198,7 +198,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source": { "type": "string" },
|
||||
"value": { "type": "string" }
|
||||
"value": { "type": ["integer", "string"] }
|
||||
},
|
||||
"required": [ "source", "value" ],
|
||||
"additionalProperties": false
|
||||
|
||||
@@ -24,6 +24,15 @@ public class ChannelEditViewModelValidator : AbstractValidator<ChannelEditViewMo
|
||||
.Must(Artwork.IsExternalUrl)
|
||||
.WithMessage("External logo url is invalid");
|
||||
});
|
||||
|
||||
When(
|
||||
x => x.IsEnabled == false,
|
||||
() =>
|
||||
{
|
||||
RuleFor(x => x.ShowInEpg)
|
||||
.Must(x => x == false)
|
||||
.WithMessage("Disabled channels cannot be shown in EPG");
|
||||
});
|
||||
}
|
||||
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
|
||||
Reference in New Issue
Block a user