From beb8562690e341118f07449b8e8a7004e1dd7450 Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sat, 8 Mar 2025 19:40:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20BeatLeader=20?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E6=88=90=E7=BB=A9=E8=8E=B7=E5=8F=96=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E9=97=B4=E5=92=8C=E7=8E=A9=E5=AE=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/beatleader/bind_bl.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/service/beatleader/bind_bl.go b/service/beatleader/bind_bl.go index 4f0680a..6b0a0dd 100644 --- a/service/beatleader/bind_bl.go +++ b/service/beatleader/bind_bl.go @@ -319,7 +319,10 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er // } // return records, nil - + playerData, err := FetchPlayerData(blId) + if err != nil { + return nil, err + } //从线上获取 historyUrl := "https://api.beatleader.xyz/player/%s/scores?count=%d" fullUrl := fmt.Sprintf(historyUrl, blId, count) @@ -344,9 +347,9 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er for _, score := range scores { dataLite := RecordDataLite{ ScoreID: score.ID, - BlID: score.Player.ID, - Name: score.Player.Name, - Country: score.Player.Country, + BlID: blId, + Name: playerData.Name, + Country: playerData.Country, SongName: score.Leaderboard.Song.Name, SongSubName: score.Leaderboard.Song.SubName, SongAuthorName: score.Leaderboard.Song.Author, @@ -367,7 +370,7 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er DeviceHmd: GetHMDStr(score.HMD), DeviceControllerLeft: GetControllerStr(score.Controller), DeviceControllerRight: GetControllerStr(score.Controller), - GeneratedTime: time.Now().Format("2006-01-02 15:04:05.999999999-07:00"), + GeneratedTime: time.Unix(score.Timepost, 0).Format("2006-01-02 15:04:05.999999999-07:00"), } if score.Leaderboard.Difficulty.Stars != nil { dataLite.Stars = *score.Leaderboard.Difficulty.Stars