Browse Source

clean up tables (#78)

* add plex library sorting options

* add playout sorting options
pull/79/head
Jason Dove 5 years ago committed by GitHub
parent
commit
898a21dcd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      ErsatzTV/Pages/Playouts.razor
  2. 14
      ErsatzTV/Pages/PlexLibrariesEditor.razor
  3. 5
      ErsatzTV/Pages/Schedules.razor

18
ErsatzTV/Pages/Playouts.razor

@ -11,20 +11,25 @@
<MudText Typo="Typo.h6">Playouts</MudText> <MudText Typo="Typo.h6">Playouts</MudText>
</ToolBarContent> </ToolBarContent>
<ColGroup> <ColGroup>
<col/>
<col/> <col/>
<col/> <col/>
<col style="width: 120px;"/> <col style="width: 120px;"/>
</ColGroup> </ColGroup>
<HeaderContent> <HeaderContent>
<MudTh>Id</MudTh> <MudTh>
<MudTh>Channel</MudTh> <MudTableSortLabel SortBy="new Func<PlayoutViewModel, object>(x => decimal.Parse(x.Channel.Number))">
<MudTh>Schedule</MudTh> Channel
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel SortBy="new Func<PlayoutViewModel, object>(x => x.ProgramSchedule.Name)">
Schedule
</MudTableSortLabel>
</MudTh>
@* <MudTh>Playout Type</MudTh> *@ @* <MudTh>Playout Type</MudTh> *@
<MudTh/> <MudTh/>
</HeaderContent> </HeaderContent>
<RowTemplate> <RowTemplate>
<MudTd DataLabel="Id">@context.Id</MudTd>
<MudTd DataLabel="Channel">@context.Channel.Number - @context.Channel.Name</MudTd> <MudTd DataLabel="Channel">@context.Channel.Number - @context.Channel.Name</MudTd>
<MudTd DataLabel="Schedule">@context.ProgramSchedule.Name</MudTd> <MudTd DataLabel="Schedule">@context.ProgramSchedule.Name</MudTd>
@* <MudTd DataLabel="Playout Type">@context.ProgramSchedulePlayoutType</MudTd> *@ @* <MudTd DataLabel="Playout Type">@context.ProgramSchedulePlayoutType</MudTd> *@
@ -110,7 +115,8 @@
} }
private async Task LoadAllPlayouts() => private async Task LoadAllPlayouts() =>
_playouts = await Mediator.Send(new GetAllPlayouts()); _playouts = await Mediator.Send(new GetAllPlayouts())
.Map(list => list.OrderBy(x => decimal.Parse(x.Channel.Number)).ToList());
} }

14
ErsatzTV/Pages/PlexLibrariesEditor.razor

@ -20,8 +20,16 @@
<col style="width: 100px;"/> <col style="width: 100px;"/>
</ColGroup> </ColGroup>
<HeaderContent> <HeaderContent>
<MudTh>Name</MudTh> <MudTh>
<MudTh>Media Type</MudTh> <MudTableSortLabel SortBy="new Func<PlexMediaSourceLibraryEditViewModel, object>(x => x.Name)">
Name
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel SortBy="new Func<PlexMediaSourceLibraryEditViewModel, object>(x => x.MediaKind)">
Media Kind
</MudTableSortLabel>
</MudTh>
<MudTh>Synchronize</MudTh> <MudTh>Synchronize</MudTh>
</HeaderContent> </HeaderContent>
<RowTemplate> <RowTemplate>
@ -55,7 +63,7 @@
{ {
_source = source; _source = source;
_libraries = await Mediator.Send(new GetPlexLibrariesBySourceId(Id)) _libraries = await Mediator.Send(new GetPlexLibrariesBySourceId(Id))
.Map(list => list.Map(ProjectToEditViewModel).ToList()); .Map(list => list.Map(ProjectToEditViewModel).OrderBy(x => x.MediaKind).ThenBy(x => x.Name).ToList());
}, },
() => () =>
{ {

5
ErsatzTV/Pages/Schedules.razor

@ -11,19 +11,16 @@
<MudText Typo="Typo.h6">Schedules</MudText> <MudText Typo="Typo.h6">Schedules</MudText>
</ToolBarContent> </ToolBarContent>
<ColGroup> <ColGroup>
<col/>
<col/> <col/>
<col/> <col/>
<col style="width: 180px;"/> <col style="width: 180px;"/>
</ColGroup> </ColGroup>
<HeaderContent> <HeaderContent>
<MudTh>Id</MudTh>
<MudTh>Name</MudTh> <MudTh>Name</MudTh>
<MudTh>Collection Playback Order</MudTh> <MudTh>Collection Playback Order</MudTh>
<MudTh/> <MudTh/>
</HeaderContent> </HeaderContent>
<RowTemplate> <RowTemplate>
<MudTd DataLabel="Id">@context.Id</MudTd>
<MudTd DataLabel="Name">@context.Name</MudTd> <MudTd DataLabel="Name">@context.Name</MudTd>
<MudTd DataLabel="Name">@context.MediaCollectionPlaybackOrder</MudTd> <MudTd DataLabel="Name">@context.MediaCollectionPlaybackOrder</MudTd>
<MudTd> <MudTd>
@ -88,7 +85,7 @@
{ {
_selectedSchedule = schedule; _selectedSchedule = schedule;
await Mediator.Send(new GetProgramScheduleItems(schedule.Id)) await Mediator.Send(new GetProgramScheduleItems(schedule.Id))
.IterT(results => _selectedScheduleItems = results.ToList()); .IterT(results => _selectedScheduleItems = results.OrderBy(x => x.Name).ToList());
} }
private async Task DeleteSchedule(ProgramScheduleViewModel programSchedule) private async Task DeleteSchedule(ProgramScheduleViewModel programSchedule)

Loading…
Cancel
Save