* wip * start to add jellyfin tables to db * code cleanup * finish adding jellyfin media source * sync jellyfin libraries * display list of jellyfin libraries * toggle jellyfin library sync * edit jellyfin path replacements * noop jellyfin scanners * get jellyfin admin user id on startup * implement jellyfin disconnect * add jellyfin libraries to list; start to query jellyfin library items * code cleanup * start to project jellyfin movies * save new jellyfin movies to db * basic jellyfin movie update * load jellyfin actor artwork * load jellyfin movie poster and fan art * more jellyfin artwork fixes, sync audio streams * jellyfin playback sort of works * skip jellyfin movies that are inaccessible * use ffprobe for jellyfin movie statistics * code cleanup * store jellyfin operating system * more jellyfin movie updates * update jellyfin movie poster and fan art * add jellyfin tv types * sync jellyfin shows * sync jellyfin seasons * sync jellyfin episodes * remove missing jellyfin television items * delete empty jellyfin seasons and shows * fix jellyfin updates * fix indexing jellyfin movie and show languages
66 lines
2.0 KiB
Plaintext
66 lines
2.0 KiB
Plaintext
@using ErsatzTV.Application.FFmpegProfiles
|
|
@using ErsatzTV.Application.FFmpegProfiles.Commands
|
|
@inject IMediator _mediator
|
|
@inject ISnackbar _snackbar
|
|
@inject ILogger<AddToCollectionDialog> _logger
|
|
|
|
<MudDialog>
|
|
<DialogContent>
|
|
<EditForm Model="@_dummyModel" OnSubmit="@(_ => Submit())">
|
|
<MudContainer Class="mb-6">
|
|
<MudText>
|
|
Enter a name for the new FFmpeg Profile
|
|
</MudText>
|
|
</MudContainer>
|
|
<MudTextFieldString Label="New FFmpeg Profile Name"
|
|
@bind-Text="@_newFFmpegProfileName"
|
|
Class="mb-6 mx-4">
|
|
</MudTextFieldString>
|
|
</EditForm>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="Cancel" ButtonType="ButtonType.Reset">Cancel</MudButton>
|
|
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="Submit">
|
|
Copy Profile
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog>
|
|
|
|
@code {
|
|
|
|
[CascadingParameter]
|
|
MudDialogInstance MudDialog { get; set; }
|
|
|
|
[Parameter]
|
|
public int FFmpegProfileId { get; set; }
|
|
|
|
private record DummyModel;
|
|
|
|
private readonly DummyModel _dummyModel = new();
|
|
|
|
private string _newFFmpegProfileName;
|
|
|
|
private bool CanSubmit() => !string.IsNullOrWhiteSpace(_newFFmpegProfileName);
|
|
|
|
private async Task Submit()
|
|
{
|
|
if (!CanSubmit())
|
|
{
|
|
return;
|
|
}
|
|
|
|
Either<BaseError, FFmpegProfileViewModel> maybeResult =
|
|
await _mediator.Send(new CopyFFmpegProfile(FFmpegProfileId, _newFFmpegProfileName));
|
|
|
|
maybeResult.Match(
|
|
ffmpegProfile => { MudDialog.Close(DialogResult.Ok(ffmpegProfile)); },
|
|
error =>
|
|
{
|
|
_snackbar.Add(error.Value, Severity.Error);
|
|
_logger.LogError("Error copying FFmpeg Profile: {Error}", error.Value);
|
|
MudDialog.Close(DialogResult.Cancel());
|
|
});
|
|
}
|
|
|
|
private void Cancel(MouseEventArgs e) => MudDialog.Cancel();
|
|
} |