diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-07-24 14:40:22 +0300 |
| commit | b0d199936b546c75d4b19d99591237f0bf97fe55 (patch) | |
| tree | e9391880e7db2bd1ea8ff25d91aeea8dd98f186e /backend/handlers/home.go | |
| parent | fix/frontend: fixed sidebar title size, removed unnecessary imports (diff) | |
| parent | feat/backend: add newrelic integration (#274) (diff) | |
| download | lphub-css-overhaul.tar.gz lphub-css-overhaul.tar.bz2 lphub-css-overhaul.zip | |
Merge branch 'main' into css-overhaulcss-overhaul
Diffstat (limited to 'backend/handlers/home.go')
| -rw-r--r-- | backend/handlers/home.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/backend/handlers/home.go b/backend/handlers/home.go index 714610a..095b666 100644 --- a/backend/handlers/home.go +++ b/backend/handlers/home.go | |||
| @@ -6,6 +6,7 @@ import ( | |||
| 6 | "log" | 6 | "log" |
| 7 | "net/http" | 7 | "net/http" |
| 8 | "os" | 8 | "os" |
| 9 | "sort" | ||
| 9 | "strings" | 10 | "strings" |
| 10 | 11 | ||
| 11 | "lphub/database" | 12 | "lphub/database" |
| @@ -106,6 +107,15 @@ func RankingsLPHUB(c *gin.Context) { | |||
| 106 | } | 107 | } |
| 107 | } | 108 | } |
| 108 | } | 109 | } |
| 110 | // Sort the overall rankings | ||
| 111 | sort.Slice(response.Overall, func(i, j int) bool { | ||
| 112 | a := response.Overall[i] | ||
| 113 | b := response.Overall[j] | ||
| 114 | if a.TotalScore == b.TotalScore { | ||
| 115 | return a.User.SteamID < b.User.SteamID | ||
| 116 | } | ||
| 117 | return a.TotalScore < b.TotalScore | ||
| 118 | }) | ||
| 109 | 119 | ||
| 110 | placement := 1 | 120 | placement := 1 |
| 111 | ties := 0 | 121 | ties := 0 |
| @@ -317,7 +327,7 @@ func SearchWithQuery(c *gin.Context) { | |||
| 317 | {ID: 80, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Catapult Block"}, | 327 | {ID: 80, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Catapult Block"}, |
| 318 | {ID: 81, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Bridge Fling"}, | 328 | {ID: 81, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Bridge Fling"}, |
| 319 | {ID: 82, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Turret Walls"}, | 329 | {ID: 82, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Turret Walls"}, |
| 320 | {ID: 83, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Turret Assasin"}, | 330 | {ID: 83, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Turret Assassin"}, |
| 321 | {ID: 84, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Bridge Testing"}, | 331 | {ID: 84, Game: "Portal 2 - Cooperative", Chapter: "Course 3 - Hard-Light Surfaces", Map: "Bridge Testing"}, |
| 322 | {ID: 85, Game: "Portal 2 - Cooperative", Chapter: "Course 4 - Excursion Funnels", Map: "Cooperative Funnels"}, | 332 | {ID: 85, Game: "Portal 2 - Cooperative", Chapter: "Course 4 - Excursion Funnels", Map: "Cooperative Funnels"}, |
| 323 | {ID: 86, Game: "Portal 2 - Cooperative", Chapter: "Course 4 - Excursion Funnels", Map: "Funnel Drill"}, | 333 | {ID: 86, Game: "Portal 2 - Cooperative", Chapter: "Course 4 - Excursion Funnels", Map: "Funnel Drill"}, |