diff --git a/LANCommander/Pages/Games/Index.razor b/LANCommander/Pages/Games/Index.razor index e57f900..4a8cc58 100644 --- a/LANCommander/Pages/Games/Index.razor +++ b/LANCommander/Pages/Games/Index.razor @@ -1,7 +1,7 @@ @page "/Games" @inject GameService GameService - + Games @@ -21,7 +21,7 @@ - + @context.Title @context.SortTitle @@ -30,7 +30,7 @@ @context.CreatedBy?.UserName @context.UpdatedOn @context.UpdatedBy?.UserName - + Edit @@ -46,6 +46,20 @@ protected override async Task OnInitializedAsync() { - Games = GameService.Get(); + Games = GameService.Get().OrderBy(g => String.IsNullOrWhiteSpace(g.SortTitle) ? g.Title : g.SortTitle).ToList(); + } + + private string GetIcon(Game game) + { + try + { + var icon = GameService.GetIcon(game); + + return $"data:image/png;base64,{Convert.ToBase64String(icon)}"; + } + catch + { + return ""; + } } }