add troubleshoot button to classic schedules (#2615)
* add troubleshoot button to classic schedules * move troubleshoot button
This commit is contained in:
@@ -29,6 +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 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
|
||||
|
||||
@@ -1134,5 +1134,4 @@
|
||||
}
|
||||
|
||||
private string SelectedRowClassFunc(ProgramScheduleItemEditViewModel element, int rowNumber) => _selectedItem != null && _selectedItem == element ? "selected" : string.Empty;
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<ColGroup>
|
||||
<MudHidden Breakpoint="Breakpoint.Xs">
|
||||
<col/>
|
||||
<col style="width: 240px;"/>
|
||||
<col style="width: 300px;"/>
|
||||
</MudHidden>
|
||||
</ColGroup>
|
||||
<ToolBarContent>
|
||||
@@ -58,6 +58,11 @@
|
||||
OnClick="@(_ => CopySchedule(context))">
|
||||
</MudIconButton>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Troubleshoot">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Info"
|
||||
OnClick="@(_ => Troubleshoot(context))">
|
||||
</MudIconButton>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Delete Schedule">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
OnClick="@(_ => DeleteSchedule(context))">
|
||||
@@ -213,5 +218,17 @@
|
||||
_table.ReloadServerData();
|
||||
}
|
||||
|
||||
private async Task Troubleshoot(ProgramScheduleViewModel schedule)
|
||||
{
|
||||
Option<IEnumerable<ProgramScheduleItemViewModel>> maybeResults = await Mediator.Send(new GetProgramScheduleItems(schedule.Id), _cts.Token);
|
||||
foreach (IEnumerable<ProgramScheduleItemViewModel> 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<ScheduleItemsDialog>(schedule.Name, parameters, options);
|
||||
DialogResult _ = await dialog.Result;
|
||||
}
|
||||
}
|
||||
|
||||
private string SelectedRowClassFunc(ProgramScheduleViewModel element, int rowNumber) => _selectedSchedule != null && _selectedSchedule == element ? "selected" : string.Empty;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
@using System.Text.Json
|
||||
@using System.Text.Json.Serialization
|
||||
@using ErsatzTV.Application.ProgramSchedules
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<div>
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_infoView">@_info</code>
|
||||
</pre>
|
||||
</div>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(() => CopyToClipboard(_infoView))">
|
||||
Copy
|
||||
</MudButton>
|
||||
<MudButton Color="Color.Primary" OnClick="@Close">Close</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[CascadingParameter]
|
||||
IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public ProgramScheduleViewModel Schedule { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public IEnumerable<ProgramScheduleItemViewModel> Items { get; set; }
|
||||
|
||||
private string _info;
|
||||
private ElementReference _infoView;
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_info = JsonSerializer.Serialize(
|
||||
new
|
||||
{
|
||||
Schedule,
|
||||
Items
|
||||
},
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
Converters = { new JsonStringEnumConverter() },
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
WriteIndented = true
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_info = ex.ToString();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task CopyToClipboard(ElementReference view) => await JsRuntime.InvokeVoidAsync("clipboardCopy.copyText", view);
|
||||
|
||||
private void Close() => MudDialog.Close(DialogResult.Ok(true));
|
||||
}
|
||||
Reference in New Issue
Block a user