Browse Source

fix collection item sorting in ui (#52)

pull/1213/head
Jason Dove 5 years ago committed by GitHub
parent
commit
aa96f617af
  1. 8
      ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs
  2. 6
      ErsatzTV/Pages/CollectionItems.razor

8
ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs

@ -16,11 +16,11 @@ namespace ErsatzTV.Application.MediaCards.Queries @@ -16,11 +16,11 @@ namespace ErsatzTV.Application.MediaCards.Queries
public GetCollectionCardsHandler(IMediaCollectionRepository collectionRepository) =>
_collectionRepository = collectionRepository;
public async Task<Either<BaseError, CollectionCardResultsViewModel>> Handle(
public Task<Either<BaseError, CollectionCardResultsViewModel>> Handle(
GetCollectionCards request,
CancellationToken cancellationToken) =>
(await _collectionRepository.GetCollectionWithItemsUntracked(request.Id))
.ToEither(BaseError.New("Unable to load collection"))
.Map(ProjectToViewModel);
_collectionRepository.GetCollectionWithItemsUntracked(request.Id)
.Map(c => c.ToEither(BaseError.New("Unable to load collection")))
.MapT(ProjectToViewModel);
}
}

6
ErsatzTV/Pages/CollectionItems.razor

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Movies</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (MovieCardViewModel card in _data.MovieCards)
@foreach (MovieCardViewModel card in _data.MovieCards.OrderBy(m => m.SortTitle))
{
<MediaCard Data="@card"
Link="@($"/media/movies/{card.MovieId}")"
@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Television Shows</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (TelevisionShowCardViewModel card in _data.ShowCards)
@foreach (TelevisionShowCardViewModel card in _data.ShowCards.OrderBy(m => m.SortTitle))
{
<MediaCard Data="@card"
Link="@($"/media/tv/shows/{card.TelevisionShowId}")"
@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Television Seasons</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (TelevisionSeasonCardViewModel card in _data.SeasonCards)
@foreach (TelevisionSeasonCardViewModel card in _data.SeasonCards.OrderBy(m => m.SortTitle))
{
<MediaCard Data="@card"
Link="@($"/media/tv/seasons/{card.TelevisionSeasonId}")"

Loading…
Cancel
Save