@page "/ffmpeg" @using ErsatzTV.Application.FFmpegProfiles @implements IDisposable @inject IDialogService _dialog @inject IMediator _mediator @inject ILogger _logger @inject ISnackbar _snackbar @inject NavigationManager _navigationManager FFmpeg Profiles Colored settings will be normalized Name Transcode Resolution Video Codec Audio Codec @context.Name @(context.Transcode ? "Yes" : "No") @context.Resolution.Name @context.VideoCodec @context.AudioCodec
Add Profile
@code { private readonly CancellationTokenSource _cts = new(); private List _ffmpegProfiles; public void Dispose() { _cts.Cancel(); _cts.Dispose(); } protected override async Task OnParametersSetAsync() => await LoadFFmpegProfilesAsync(_cts.Token); private async Task LoadFFmpegProfilesAsync(CancellationToken cancellationToken) => _ffmpegProfiles = await _mediator.Send(new GetAllFFmpegProfiles(), cancellationToken); 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("Delete FFmpeg Profile", parameters, options); DialogResult result = await dialog.Result; if (!result.Cancelled) { await _mediator.Send(new DeleteFFmpegProfile(ffmpegProfile.Id), _cts.Token); await LoadFFmpegProfilesAsync(_cts.Token); } } private async Task CopyProfileAsync(FFmpegProfileViewModel ffmpegProfile) { var parameters = new DialogParameters { { "FFmpegProfileId", ffmpegProfile.Id } }; var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall }; IDialogReference dialog = _dialog.Show("Copy FFmpeg Profile", parameters, options); DialogResult dialogResult = await dialog.Result; if (!dialogResult.Cancelled && dialogResult.Data is FFmpegProfileViewModel data) { _navigationManager.NavigateTo($"/ffmpeg/{data.Id}"); } } }