diff --git a/utils/utils.go b/utils/utils.go index 7a86457..45d71e8 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -166,6 +166,7 @@ type MetaStatsResponse struct { WeaponDmg []*WeaponDmg `json:"weapon_dmg,omitempty"` WinMaps map[string]float32 `json:"win_maps,omitempty"` TieMaps map[string]float32 `json:"tie_maps,omitempty"` + TotalMaps map[string]int `json:"total_maps,omitempty"` } type MatchResponse struct { @@ -355,6 +356,10 @@ func GetMetaStats(dbPlayer *ent.Player) (*MetaStatsResponse, error) { mResponse.TieMaps[tMap] = float32(ties) / float32(mapMatchTotal[tMap]) } + for tMap, total := range mapMatchTotal { + mResponse.TotalMaps[tMap] = total + } + // sort all results sort.Slice(mResponse.BestMates, func(i, j int) bool { return mResponse.BestMates[i].WinRate > mResponse.BestMates[j].WinRate