diff --git a/CHANGELOG.md b/CHANGELOG.md index 65664b11..126852cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - All new (split) settings pages - Channel editor - FFmpeg Profile editor + - Schedule editor ### Fixed - Fix QSV acceleration in docker with older Intel devices diff --git a/ErsatzTV/Pages/ScheduleEditor.razor b/ErsatzTV/Pages/ScheduleEditor.razor index 010b5c84..df00eacd 100644 --- a/ErsatzTV/Pages/ScheduleEditor.razor +++ b/ErsatzTV/Pages/ScheduleEditor.razor @@ -8,60 +8,64 @@ @inject ISnackbar Snackbar @inject IMediator Mediator - -
- @(IsEdit ? "Edit Schedule" : "Add Schedule") - - - - - - - - - - - - - - - - - - - - - - - - - - - Strict - Always Wait For Exact Start Time - Flexible - Start As Soon As Possible After Start Time - - - - - - @(IsEdit ? "Save Changes" : "Add Schedule") - - - - + + + @(IsEdit ? "Save Schedule" : "Add Schedule") + +
+ + Schedule + + +
+ Name +
+ +
+ +
+ Keep Multi-Part Episodes Together +
+ + Group multi-part episodes when shuffling + +
+ +
+ Treat Collections As Shows +
+ + This is useful for multi-part crossover episodes + +
+ +
+ Shuffle Schedule Items +
+ + Note: this disables fixed start times and flood mode + +
+ +
+ Random Start Point +
+ +
+ +
+ Fixed Start Time Behavior +
+ + Strict - Wait For Exact Start Time + Flexible - Start As Soon As Possible + +
+
- +
@code { private readonly CancellationTokenSource _cts = new(); @@ -70,8 +74,7 @@ public int Id { get; set; } private readonly ProgramScheduleEditViewModel _model = new(); - private EditContext _editContext; - private ValidationMessageStore _messageStore; + private bool _success; public void Dispose() { @@ -103,18 +106,11 @@ } } - protected override void OnInitialized() - { - _editContext = new EditContext(_model); - _messageStore = new ValidationMessageStore(_editContext); - } - private bool IsEdit => Id > 0; private async Task HandleSubmitAsync() { - _messageStore.Clear(); - if (_editContext.Validate()) + if (_success) { Either result = IsEdit ? await Mediator.Send(_model.ToUpdate(), _cts.Token).MapT(r => r as EntityIdResult) diff --git a/ErsatzTV/Validators/ProgramScheduleEditViewModelValidator.cs b/ErsatzTV/Validators/ProgramScheduleEditViewModelValidator.cs deleted file mode 100644 index 5ebe2823..00000000 --- a/ErsatzTV/Validators/ProgramScheduleEditViewModelValidator.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ErsatzTV.ViewModels; -using FluentValidation; - -namespace ErsatzTV.Validators; - -public class ProgramScheduleEditViewModelValidator : AbstractValidator -{ - public ProgramScheduleEditViewModelValidator() => RuleFor(vm => vm.Name).NotEmpty(); -}