diff --git a/service/scoresaber/bind_ss.go b/service/scoresaber/bind_ss.go index 13c994c..26155cf 100644 --- a/service/scoresaber/bind_ss.go +++ b/service/scoresaber/bind_ss.go @@ -338,7 +338,7 @@ func (ss *ssQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er } `json:"playerScores"` } records := make([]RecordDataLite, 0) - for i := 0; i < count/8; i++ { + for i := range (count-1)/8 + 1 { fullUrl := fmt.Sprintf(historyUrl, ssId, i+1) resp, err := http.Get(fullUrl) if err != nil { @@ -354,8 +354,8 @@ func (ss *ssQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er return nil, err } scores := response.Data - for k, score := range scores { - if k > count-1 { + for _, score := range scores { + if len(records) > count { break } record := RecordDataLite{