more add to playlist buttons; fix playlist preview (#1693)

This commit is contained in:
Jason Dove
2024-04-28 08:59:14 -05:00
committed by GitHub
parent 202ae33e37
commit a6d5df3ca6
20 changed files with 425 additions and 1 deletions
+21
View File
@@ -62,6 +62,13 @@
OnClick="@AddToCollection">
Add To Collection
</MudButton>
<MudButton Class="ml-3"
Variant="Variant.Filled"
Color="Color.Primary"
StartIcon="@Icons.Material.Filled.PlaylistAdd"
OnClick="@AddToPlaylist">
Add To Playlist
</MudButton>
<MudButton Class="ml-3"
Variant="Variant.Filled"
Color="Color.Primary"
@@ -220,6 +227,20 @@
}
}
private async Task AddToPlaylist()
{
var parameters = new DialogParameters { { "EntityType", "show" }, { "EntityName", _show.Title } };
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
IDialogReference dialog = await _dialog.ShowAsync<AddToPlaylistDialog>("Add To Playlist", parameters, options);
DialogResult result = await dialog.Result;
if (!result.Canceled && result.Data is PlaylistViewModel playlist)
{
await _mediator.Send(new AddShowToPlaylist(playlist.Id, ShowId), _cts.Token);
_navigationManager.NavigateTo($"media/playlists/{playlist.Id}");
}
}
private async Task AddToSchedule()
{
var parameters = new DialogParameters { { "EntityType", "show" }, { "EntityName", _show.Title } };