diff --git a/main.go b/main.go index 4edf7b3..4132d79 100644 --- a/main.go +++ b/main.go @@ -601,6 +601,10 @@ func getMatch(w http.ResponseWriter, r *http.Request) { Stats: []*utils.StatsResponse{}, } + if tMatch.Date.Before(time.Now().AddDate(0, 0, -30)) { + mResponse.ReplayURL = tMatch.ReplayURL + } + db.Lock.RLock() tStats, err := tMatch.QueryStats().WithPlayers().All(context.Background()) db.Lock.RUnlock() diff --git a/utils/utils.go b/utils/utils.go index 72ebefa..d77fcfa 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -157,6 +157,7 @@ type MatchResponse struct { MatchResult int `json:"match_result"` MaxRounds int `json:"max_rounds,omitempty"` Parsed bool `json:"parsed"` + ReplayURL string `json:"replay_url,omitempty"` Stats interface{} `json:"stats,omitempty"` }