From 0d46affa306492d6b6646590fe4f3c8683ad63fd Mon Sep 17 00:00:00 2001
From: Simon <63975668+Simyon264@users.noreply.github.com>
Date: Thu, 22 Aug 2024 18:43:45 +0200
Subject: [PATCH] Per server leaderboards (#46)
* Per server leaderboards
* Changelog
---
ReplayBrowser/Pages/Changelog.razor | 1 +
ReplayBrowser/Pages/Leaderboard.razor | 67 +++++++++++++++++++-
ReplayBrowser/Services/LeaderboardService.cs | 26 ++++++--
3 files changed, 86 insertions(+), 8 deletions(-)
diff --git a/ReplayBrowser/Pages/Changelog.razor b/ReplayBrowser/Pages/Changelog.razor
index 8630f86..34763cd 100644
--- a/ReplayBrowser/Pages/Changelog.razor
+++ b/ReplayBrowser/Pages/Changelog.razor
@@ -16,6 +16,7 @@
Added a new contributors page.
Improved speed on the entire site by a whole bunch.
Added a favicon
+ Added per server leaderboards
12.08.2024
diff --git a/ReplayBrowser/Pages/Leaderboard.razor b/ReplayBrowser/Pages/Leaderboard.razor
index e15561c..2386af8 100644
--- a/ReplayBrowser/Pages/Leaderboard.razor
+++ b/ReplayBrowser/Pages/Leaderboard.razor
@@ -1,11 +1,11 @@
@page "/leaderboard"
@using Microsoft.AspNetCore.Components.Authorization
-@using ReplayBrowser.Data
@using ReplayBrowser.Models
@using ReplayBrowser.Services
@using Microsoft.AspNetCore.Components.Web
@using ReplayBrowser.Helpers
@using ReplayBrowser.Pages.Shared
+
@inject NavigationManager NavigationManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject IConfiguration Configuration
@@ -58,8 +58,40 @@ else
id="search"
value="@username"
>
-
+
+
+
+
+
+ @{
+ var urls = Configuration.GetSection("ReplayUrls").Get()!;
+ var selectedServersQuery = queryDictionary["selectedServers"];
+ if (selectedServersQuery == null)
+ {
+ selectedServersQuery = urls.Select(x => x.FallBackServerName).Aggregate((x, y) => $"{x},{y}");
+ }
+
+ var selectedServers = selectedServersQuery.Split(',');
+ foreach (var storage in urls)
+ {
+ // Server selection
+
+
+ }
+ }
+
+
+
@@ -125,10 +157,22 @@ else
}