From 10eba59c63df2b34b9b93cdbc7cbb5235089cf6c Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Wed, 2 Apr 2025 00:23:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20FetchCountryLeaderb?= =?UTF-8?q?oard=20=E5=87=BD=E6=95=B0=E4=B8=AD=E7=9A=84=E5=81=8F=E7=A7=BB?= =?UTF-8?q?=E9=87=8F=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E5=88=86=E9=A1=B5=E8=AE=A1=E7=AE=97=E4=BB=8E1?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E4=BB=A5=E6=8F=90=E9=AB=98=E5=87=86=E7=A1=AE?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/scoresaber/user_info.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/scoresaber/user_info.go b/service/scoresaber/user_info.go index 202bf26..4d66a99 100644 --- a/service/scoresaber/user_info.go +++ b/service/scoresaber/user_info.go @@ -140,10 +140,10 @@ type LeaderboardData struct { func FetchCountryLeaderboard(country string, offset int, ssID string) (LeaderboardData, error) { // 根据偏移量计算页数 - if offset < 0 { - offset = 0 + if offset < 1 { + offset = 1 } - page := offset / 50 + page := (offset-1)/50 + 1 url := fmt.Sprintf("https://scoresaber.com/api/players?countries=%s&page=%d", country, page) // 创建请求