diff --git a/TASVideos/Pages/Games/Index.cshtml b/TASVideos/Pages/Games/Index.cshtml
index 10a55beab..533c4f7f0 100644
--- a/TASVideos/Pages/Games/Index.cshtml
+++ b/TASVideos/Pages/Games/Index.cshtml
@@ -131,7 +131,7 @@
{
- @foreach (var sub in goal.Submissions.OrderByDescending(s => s.Id))
+ @foreach (var sub in goal.Submissions)
{
-
@sub.Title
diff --git a/TASVideos/Pages/Games/Index.cshtml.cs b/TASVideos/Pages/Games/Index.cshtml.cs
index ac6ecdadf..da237584c 100644
--- a/TASVideos/Pages/Games/Index.cshtml.cs
+++ b/TASVideos/Pages/Games/Index.cshtml.cs
@@ -44,15 +44,15 @@ public async Task OnGet()
UserFilesCount = g.UserFiles.Count(uf => !uf.Hidden),
PlaygroundGoals = g.Submissions
.Where(s => s.Status == SubmissionStatus.Playground)
- .Select(s => s.GameGoal)
- .Select(g => new GoalEntry(
- g.Id,
- g.DisplayName,
- g.Submissions
- .Where(s => s.Status == SubmissionStatus.Playground)
- .Select(s => new SubmissionEntry(s.Id, s.Title))
+ .GroupBy(s => s.GameGoal)
+ .OrderBy(gg => gg.Key!.DisplayName.Length)
+ .Select(gg => new GoalEntry(
+ gg.Key!.Id,
+ gg.Key!.DisplayName,
+ gg.OrderByDescending(ggs => ggs.Id)
+ .Select(ggs => new SubmissionEntry(ggs.Id, ggs.Title))
.ToList()))
- .ToList()
+ .ToList(),
});
query = ParsedId > 0