update dashboard

This commit is contained in:
Michael Simard
2021-12-06 23:55:05 -06:00
parent e2f6a1b73a
commit 14184ac665

View File

@@ -168,6 +168,13 @@ struct StatsController: RouteCollection {
sortOrder = -79
backgroundColor = colors.first(where: {$0.gameId == "bocw"})?.tileColour ?? backgroundColor
}
else if statisticItem.codTrackerId == "vg_competitive"{
title2 = "Ratio"
content1 = "\(statisticItem.wins)-\(statisticItem.losses)"
content2 = Utils.getRatio(wins: statisticItem.wins, losses: statisticItem.losses)
sortOrder = -81
backgroundColor = colors.first(where: {$0.gameId == "vg"})?.tileColour ?? backgroundColor
}
else {
@@ -691,7 +698,8 @@ struct StatsController: RouteCollection {
var mwFivePlayers:Stats?
var overallFourPlayers:Stats?
var blackOpsColdWarNuketownHalloween:Stats?
var vgCompetitive:StatsWithMostRecentDailyRecord?
// var mapStats:[Int:Stats]?
@@ -752,6 +760,17 @@ struct StatsController: RouteCollection {
}
group.enter()
queue.async {
vgCompetitive = self.getStatsWithMostRecentDailyRecord(sortedMatches: matches.filter({ (match) -> Bool in
return match.codGame == "vg" && self.shouldCountMatch(match: match )
}))
group.leave()
}
group.wait()
return [
@@ -769,6 +788,8 @@ struct StatsController: RouteCollection {
"casual_overall":Stats(totalWins: casualOverall.totalWins, totalLosses: casualOverall.totalLosses),
"bocw_casual":Stats(totalWins: bocwCasual.totalWins, totalLosses: bocwCasual.totalLosses),
"vg_casual":Stats(totalWins: vgCasual.totalWins, totalLosses: vgCasual.totalLosses),
"vg_competitive":Stats(totalWins: vgCompetitive!.totalWins, totalLosses: vgCompetitive!.totalLosses),
]
}