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
public GetCollectionCardsHandler(IMediaCollectionRepository collectionRepository) => public GetCollectionCardsHandler(IMediaCollectionRepository collectionRepository) =>
_collectionRepository = collectionRepository; _collectionRepository = collectionRepository;
public async Task<Either<BaseError, CollectionCardResultsViewModel>> Handle( public Task<Either<BaseError, CollectionCardResultsViewModel>> Handle(
GetCollectionCards request, GetCollectionCards request,
CancellationToken cancellationToken) => CancellationToken cancellationToken) =>
(await _collectionRepository.GetCollectionWithItemsUntracked(request.Id)) _collectionRepository.GetCollectionWithItemsUntracked(request.Id)
.ToEither(BaseError.New("Unable to load collection")) .Map(c => c.ToEither(BaseError.New("Unable to load collection")))
.Map(ProjectToViewModel); .MapT(ProjectToViewModel);
} }
} }

6
ErsatzTV/Pages/CollectionItems.razor

@ -21,7 +21,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Movies</MudText> <MudText GutterBottom="true" Typo="Typo.h4">Movies</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> <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" <MediaCard Data="@card"
Link="@($"/media/movies/{card.MovieId}")" Link="@($"/media/movies/{card.MovieId}")"
@ -35,7 +35,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Television Shows</MudText> <MudText GutterBottom="true" Typo="Typo.h4">Television Shows</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> <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" <MediaCard Data="@card"
Link="@($"/media/tv/shows/{card.TelevisionShowId}")" Link="@($"/media/tv/shows/{card.TelevisionShowId}")"
@ -49,7 +49,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Television Seasons</MudText> <MudText GutterBottom="true" Typo="Typo.h4">Television Seasons</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> <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" <MediaCard Data="@card"
Link="@($"/media/tv/seasons/{card.TelevisionSeasonId}")" Link="@($"/media/tv/seasons/{card.TelevisionSeasonId}")"

Loading…
Cancel
Save