* update tv show ui * update tv season ui * list episode details on tv season page * remove episode page * remove breadcrumbs * move home link * code cleanup * update screenshots
74 lines
2.9 KiB
Plaintext
74 lines
2.9 KiB
Plaintext
@page "/media/movies/{MovieId:int}"
|
|
@using ErsatzTV.Application.Movies
|
|
@using ErsatzTV.Application.Movies.Queries
|
|
@using ErsatzTV.Application.MediaCollections
|
|
@using ErsatzTV.Application.MediaCollections.Commands
|
|
@inject IMediator Mediator
|
|
@inject IDialogService Dialog
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<MudContainer MaxWidth="MaxWidth.False" Style="padding: 0" Class="fanart-container">
|
|
<div class="fanart-tint"></div>
|
|
@if (!string.IsNullOrWhiteSpace(_movie.FanArt))
|
|
{
|
|
<img src="@($"/artwork/fanart/{_movie.FanArt}")" alt="fan art"/>
|
|
}
|
|
</MudContainer>
|
|
<MudContainer MaxWidth="MaxWidth.Large" Style="margin-top: 200px">
|
|
<div style="display: flex; flex-direction: row;">
|
|
@if (!string.IsNullOrWhiteSpace(_movie.Poster))
|
|
{
|
|
<img class="mud-elevation-2 mr-6"
|
|
style="border-radius: 4px; max-height: 440px"
|
|
src="@($"/artwork/posters/{_movie.Poster}")" alt="movie poster"/>
|
|
}
|
|
<div style="display: flex; flex-direction: column; height: 100%">
|
|
<MudText Typo="Typo.h2" Class="media-item-title">@_movie.Title</MudText>
|
|
<MudText Typo="Typo.subtitle1" Class="media-item-subtitle mb-6 mud-text-secondary">@_movie.Year</MudText>
|
|
@if (!string.IsNullOrWhiteSpace(_movie.Plot))
|
|
{
|
|
<MudCard Elevation="2" Class="mb-6">
|
|
<MudCardContent Class="mx-3 my-3" Style="height: 100%">
|
|
<MudText Style="flex-grow: 1">@_movie.Plot</MudText>
|
|
</MudCardContent>
|
|
</MudCard>
|
|
}
|
|
<div>
|
|
<MudButton Variant="Variant.Filled"
|
|
Color="Color.Primary"
|
|
StartIcon="@Icons.Material.Filled.Add"
|
|
OnClick="@AddToCollection">
|
|
Add To Collection
|
|
</MudButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</MudContainer>
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public int MovieId { get; set; }
|
|
|
|
private MovieViewModel _movie;
|
|
|
|
protected override Task OnParametersSetAsync() => RefreshData();
|
|
|
|
private Task RefreshData() =>
|
|
Mediator.Send(new GetMovieById(MovieId)).IfSomeAsync(vm => _movie = vm);
|
|
|
|
private async Task AddToCollection()
|
|
{
|
|
var parameters = new DialogParameters { { "EntityType", "movie" }, { "EntityName", _movie.Title } };
|
|
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
|
|
|
|
IDialogReference dialog = Dialog.Show<AddToCollectionDialog>("Add To Collection", parameters, options);
|
|
DialogResult result = await dialog.Result;
|
|
if (!result.Cancelled && result.Data is MediaCollectionViewModel collection)
|
|
{
|
|
await Mediator.Send(new AddMovieToCollection(collection.Id, MovieId));
|
|
NavigationManager.NavigateTo($"/media/collections/{collection.Id}");
|
|
}
|
|
}
|
|
|
|
} |