Browse Source

fix bugs with viewing movies as they are loading

pull/26/head
Jason Dove 6 years ago
parent
commit
ca032585e9
  1. 3
      ErsatzTV.Core/Scheduling/PlayoutBuilder.cs
  2. 2
      ErsatzTV/Pages/MovieList.razor
  3. 2
      ErsatzTV/Shared/MediaCard.razor

3
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -408,7 +408,8 @@ namespace ErsatzTV.Core.Scheduling
{ {
CollectionType = item.CollectionType, CollectionType = item.CollectionType,
Id = item.TelevisionSeasonId.Value Id = item.TelevisionSeasonId.Value
} },
_ => throw new ArgumentOutOfRangeException(nameof(item))
}; };
private class CollectionKey : Record<CollectionKey> private class CollectionKey : Record<CollectionKey>

2
ErsatzTV/Pages/MovieList.razor

@ -20,7 +20,7 @@
</MudContainer> </MudContainer>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> <MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (MovieCardViewModel card in _data.Cards) @foreach (MovieCardViewModel card in _data.Cards.Where(d => !string.IsNullOrWhiteSpace(d.Title)))
{ {
<MediaCard Data="@card" <MediaCard Data="@card"
DataRefreshed="@(() => RefreshData())" DataRefreshed="@(() => RefreshData())"

2
ErsatzTV/Shared/MediaCard.razor

@ -82,7 +82,7 @@
return Placeholder; return Placeholder;
} }
string first = sortTitle.Substring(0, 1).ToUpperInvariant(); string first = sortTitle?.Substring(0, 1).ToUpperInvariant() ?? string.Empty;
return int.TryParse(first, out _) ? "#" : first; return int.TryParse(first, out _) ? "#" : first;
} }

Loading…
Cancel
Save