From 1451ef6d8ea2b94664a745fd31215c71857ab1f1 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sun, 9 Nov 2025 10:16:56 -0600 Subject: [PATCH] move troubleshoot button --- CHANGELOG.md | 4 ++-- ErsatzTV/Pages/ScheduleItemsEditor.razor | 22 ---------------------- ErsatzTV/Pages/Schedules.razor | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b96e77e2a..11201cad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - There are two requirements for AviSynth Scripts to work: - FFmpeg needs to be compiled with AviSynth support (not currently available in Docker) - AviSynth itself needs to be installed -- Add `Troubleshoot` button to classic schedule items editor - - This generates JSON representing the entire schedule which can easily be shared when requested for troubleshooting +- Add `Troubleshoot` button to classic schedule list + - This generates JSON representing the entire schedule which can be shared when requested for troubleshooting ### Fixed - Fix HLS Direct playback with Jellyfin 10.11 diff --git a/ErsatzTV/Pages/ScheduleItemsEditor.razor b/ErsatzTV/Pages/ScheduleItemsEditor.razor index 6df424361..7e05c74d6 100644 --- a/ErsatzTV/Pages/ScheduleItemsEditor.razor +++ b/ErsatzTV/Pages/ScheduleItemsEditor.razor @@ -10,7 +10,6 @@ @using ErsatzTV.Core.Scheduling @implements IDisposable @inject NavigationManager NavigationManager -@inject IDialogService Dialog @inject ILogger Logger @inject ISnackbar Snackbar @inject IMediator Mediator @@ -58,16 +57,12 @@ Add Schedule Item - - Troubleshoot -
-
@@ -971,23 +966,6 @@ return result; } - private async Task Troubleshoot() - { - Option maybeSchedule = await Mediator.Send(new GetProgramScheduleById(Id), _cts.Token); - Option> maybeResults = await Mediator.Send(new GetProgramScheduleItems(Id), _cts.Token); - - foreach (ProgramScheduleViewModel schedule in maybeSchedule) - { - foreach (IEnumerable results in maybeResults) - { - var parameters = new DialogParameters { { "Schedule", schedule }, { "Items", results } }; - var options = new DialogOptions { CloseButton = true, CloseOnEscapeKey = true, MaxWidth = MaxWidth.Medium, FullWidth = true }; - IDialogReference dialog = await Dialog.ShowAsync(_schedule.Name, parameters, options); - DialogResult _ = await dialog.Result; - } - } - } - private void AddScheduleItem() { var item = new ProgramScheduleItemEditViewModel diff --git a/ErsatzTV/Pages/Schedules.razor b/ErsatzTV/Pages/Schedules.razor index a189b1f27..bbb5668e6 100644 --- a/ErsatzTV/Pages/Schedules.razor +++ b/ErsatzTV/Pages/Schedules.razor @@ -27,7 +27,7 @@ - + @@ -58,6 +58,11 @@ OnClick="@(_ => CopySchedule(context))"> + + + + @@ -213,5 +218,17 @@ _table.ReloadServerData(); } + private async Task Troubleshoot(ProgramScheduleViewModel schedule) + { + Option> maybeResults = await Mediator.Send(new GetProgramScheduleItems(schedule.Id), _cts.Token); + foreach (IEnumerable results in maybeResults) + { + var parameters = new DialogParameters { { "Schedule", schedule }, { "Items", results } }; + var options = new DialogOptions { CloseButton = true, CloseOnEscapeKey = true, MaxWidth = MaxWidth.Medium, FullWidth = true }; + IDialogReference dialog = await Dialog.ShowAsync(schedule.Name, parameters, options); + DialogResult _ = await dialog.Result; + } + } + private string SelectedRowClassFunc(ProgramScheduleViewModel element, int rowNumber) => _selectedSchedule != null && _selectedSchedule == element ? "selected" : string.Empty; }