95 lines
4.4 KiB
Plaintext
95 lines
4.4 KiB
Plaintext
@using WatchIt.Common.Model.Movies
|
|
@using WatchIt.Common.Model.Persons
|
|
@using WatchIt.Common.Model.Series
|
|
@using WatchIt.Website.Components.Pages.DatabasePage
|
|
@using WatchIt.Website.Components.Pages.DatabasePage.Subcomponents
|
|
|
|
@page "/database/{type?}"
|
|
|
|
|
|
|
|
<PageTitle>
|
|
@("WatchIt - ")
|
|
@switch (Type)
|
|
{
|
|
case "movies":
|
|
@("Movies");
|
|
break;
|
|
case "series":
|
|
@("Series");
|
|
break;
|
|
case "people":
|
|
@("People");
|
|
break;
|
|
}
|
|
@(" database")
|
|
</PageTitle>
|
|
|
|
|
|
|
|
@switch (Type)
|
|
{
|
|
case "movies":
|
|
<DatabasePageComponent TItem="MovieResponse"
|
|
TQuery="MovieQueryParameters"
|
|
Title="Movies database"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Title)"
|
|
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
|
RatingSource="@(item => item.Rating)"
|
|
UrlIdTemplate="/media/{0}"
|
|
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
|
ItemDownloadingTask="@(MoviesWebAPIService.GetAllMovies)"
|
|
SortingOptions="@(new Dictionary<string, string>
|
|
{
|
|
{ "rating.count", "Number of ratings" },
|
|
{ "rating.average", "Average rating" },
|
|
{ "title", "Title" },
|
|
{ "release_date", "Release date" },
|
|
})">
|
|
<MoviesFilterFormComponent/>
|
|
</DatabasePageComponent>
|
|
break;
|
|
case "series":
|
|
<DatabasePageComponent TItem="SeriesResponse"
|
|
TQuery="SeriesQueryParameters"
|
|
Title="TV series database"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Title)"
|
|
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
|
RatingSource="@(item => item.Rating)"
|
|
UrlIdTemplate="/media/{0}"
|
|
PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))"
|
|
ItemDownloadingTask="@(SeriesWebAPIService.GetAllSeries)"
|
|
SortingOptions="@(new Dictionary<string, string>
|
|
{
|
|
{ "rating.count", "Number of ratings" },
|
|
{ "rating.average", "Average rating" },
|
|
{ "title", "Title" },
|
|
{ "release_date", "Release date" },
|
|
})">
|
|
<SeriesFilterFormComponent/>
|
|
</DatabasePageComponent>
|
|
break;
|
|
case "people":
|
|
<DatabasePageComponent TItem="PersonResponse"
|
|
TQuery="PersonQueryParameters"
|
|
Title="People database"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Name)"
|
|
RatingSource="@(item => item.Rating)"
|
|
UrlIdTemplate="/person/{0}"
|
|
PictureDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
|
|
ItemDownloadingTask="@(PersonsWebAPIService.GetAllPersons)"
|
|
SortingOptions="@(new Dictionary<string, string>
|
|
{
|
|
{ "rating.count", "Number of ratings" },
|
|
{ "rating.average", "Average rating" },
|
|
{ "name", "Name" },
|
|
{ "birth_date", "Birth date" },
|
|
{ "death_date", "Death date" },
|
|
})">
|
|
<PersonsFilterFormComponent/>
|
|
</DatabasePageComponent>
|
|
break;
|
|
} |