From f94b9d13b8dbd1d6114b702b6765c82335e07765 Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sat, 3 May 2025 23:59:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=20FetchCountryLeaderboard=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=AF=B9=20offset?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0=E7=9A=84=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E5=85=B6=E6=9C=80=E5=B0=8F=E5=80=BC=E4=B8=BA?= =?UTF-8?q?=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/beatleader/user_info.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/beatleader/user_info.go b/service/beatleader/user_info.go index 4c73967..c23d904 100644 --- a/service/beatleader/user_info.go +++ b/service/beatleader/user_info.go @@ -69,6 +69,9 @@ func FetchPlayerData(blID string) (*PlayerData, error) { } func FetchCountryLeaderboard(country string, offset int, userId string) ([]PlayerDataLite, error) { + if offset < 1 { + offset = 1 + } url := fmt.Sprintf("https://api.beatleader.com/players?leaderboardContext=general&page=%d&count=50&sortBy=pp&mapsType=ranked&ppType=general&order=desc&countries=%s", offset/50+1, country) // 创建请求