96 lines
3.7 KiB
Plaintext
96 lines
3.7 KiB
Plaintext
@page "/ffmpeg"
|
|
@using ErsatzTV.Application.FFmpegProfiles
|
|
@using ErsatzTV.Application.FFmpegProfiles.Commands
|
|
@using ErsatzTV.Application.FFmpegProfiles.Queries
|
|
@inject IDialogService Dialog
|
|
@inject IMediator Mediator
|
|
@inject ILogger<FFmpeg> Logger
|
|
@inject ISnackbar Snackbar
|
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
|
<MudTable Hover="true" Items="_ffmpegProfiles">
|
|
<ToolBarContent>
|
|
<MudText Typo="Typo.h6">FFmpeg Profiles</MudText>
|
|
<MudToolBarSpacer></MudToolBarSpacer>
|
|
<MudText Color="Color.Tertiary">Colored settings will be normalized</MudText>
|
|
</ToolBarContent>
|
|
<ColGroup>
|
|
<col/>
|
|
<col/>
|
|
<col/>
|
|
<col/>
|
|
<col/>
|
|
<col style="width: 120px;"/>
|
|
</ColGroup>
|
|
<HeaderContent>
|
|
<MudTh>Name</MudTh>
|
|
<MudTh>Transcode</MudTh>
|
|
<MudTh>Resolution</MudTh>
|
|
<MudTh>Video Codec</MudTh>
|
|
<MudTh>Audio Codec</MudTh>
|
|
<MudTh/>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd DataLabel="Name">@context.Name</MudTd>
|
|
<MudTd DataLabel="Transcode">
|
|
@(context.Transcode ? "Yes" : "No")
|
|
</MudTd>
|
|
<MudTd DataLabel="Resolution">
|
|
<MudText Color="@(context.Transcode && context.NormalizeVideo ? Color.Tertiary : Color.Inherit)">
|
|
@context.Resolution.Name
|
|
</MudText>
|
|
</MudTd>
|
|
<MudTd DataLabel="Video Codec">
|
|
<MudText Color="@(context.Transcode && context.NormalizeVideo ? Color.Tertiary : Color.Inherit)">
|
|
@context.VideoCodec
|
|
</MudText>
|
|
</MudTd>
|
|
<MudTd DataLabel="Audio Codec">
|
|
<MudText Color="@(context.Transcode && context.NormalizeAudio ? Color.Tertiary : Color.Inherit)">
|
|
@context.AudioCodec
|
|
</MudText>
|
|
</MudTd>
|
|
<MudTd>
|
|
<div style="align-items: center; display: flex;">
|
|
<MudTooltip Text="Edit Channel">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
|
Link="@($"/ffmpeg/{context.Id}")">
|
|
</MudIconButton>
|
|
</MudTooltip>
|
|
<MudTooltip Text="Delete Channel">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
|
OnClick="@(_ => DeleteProfileAsync(context))">
|
|
</MudIconButton>
|
|
</MudTooltip>
|
|
</div>
|
|
</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" Link="/ffmpeg/add" Class="mt-4">
|
|
Add Profile
|
|
</MudButton>
|
|
</MudContainer>
|
|
|
|
@code {
|
|
private List<FFmpegProfileViewModel> _ffmpegProfiles;
|
|
|
|
protected override async Task OnParametersSetAsync() => await LoadFFmpegProfilesAsync();
|
|
|
|
private async Task LoadFFmpegProfilesAsync() =>
|
|
_ffmpegProfiles = await Mediator.Send(new GetAllFFmpegProfiles());
|
|
|
|
private async Task DeleteProfileAsync(FFmpegProfileViewModel ffmpegProfile)
|
|
{
|
|
var parameters = new DialogParameters { { "EntityType", "ffmpeg profile" }, { "EntityName", ffmpegProfile.Name } };
|
|
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
|
|
|
|
IDialogReference dialog = Dialog.Show<DeleteDialog>("Delete FFmpeg Profile", parameters, options);
|
|
DialogResult result = await dialog.Result;
|
|
if (!result.Cancelled)
|
|
{
|
|
await Mediator.Send(new DeleteFFmpegProfile(ffmpegProfile.Id));
|
|
await LoadFFmpegProfilesAsync();
|
|
}
|
|
}
|
|
|
|
} |