fix: 修正 BeatLeader 最近成绩获取中的时间和玩家信息处理
This commit is contained in:
parent
24aa3dd71a
commit
beb8562690
@ -319,7 +319,10 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// return records, nil
|
// return records, nil
|
||||||
|
playerData, err := FetchPlayerData(blId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
//从线上获取
|
//从线上获取
|
||||||
historyUrl := "https://api.beatleader.xyz/player/%s/scores?count=%d"
|
historyUrl := "https://api.beatleader.xyz/player/%s/scores?count=%d"
|
||||||
fullUrl := fmt.Sprintf(historyUrl, blId, count)
|
fullUrl := fmt.Sprintf(historyUrl, blId, count)
|
||||||
@ -344,9 +347,9 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er
|
|||||||
for _, score := range scores {
|
for _, score := range scores {
|
||||||
dataLite := RecordDataLite{
|
dataLite := RecordDataLite{
|
||||||
ScoreID: score.ID,
|
ScoreID: score.ID,
|
||||||
BlID: score.Player.ID,
|
BlID: blId,
|
||||||
Name: score.Player.Name,
|
Name: playerData.Name,
|
||||||
Country: score.Player.Country,
|
Country: playerData.Country,
|
||||||
SongName: score.Leaderboard.Song.Name,
|
SongName: score.Leaderboard.Song.Name,
|
||||||
SongSubName: score.Leaderboard.Song.SubName,
|
SongSubName: score.Leaderboard.Song.SubName,
|
||||||
SongAuthorName: score.Leaderboard.Song.Author,
|
SongAuthorName: score.Leaderboard.Song.Author,
|
||||||
@ -367,7 +370,7 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er
|
|||||||
DeviceHmd: GetHMDStr(score.HMD),
|
DeviceHmd: GetHMDStr(score.HMD),
|
||||||
DeviceControllerLeft: GetControllerStr(score.Controller),
|
DeviceControllerLeft: GetControllerStr(score.Controller),
|
||||||
DeviceControllerRight: 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 {
|
if score.Leaderboard.Difficulty.Stars != nil {
|
||||||
dataLite.Stars = *score.Leaderboard.Difficulty.Stars
|
dataLite.Stars = *score.Leaderboard.Difficulty.Stars
|
||||||
|
Loading…
x
Reference in New Issue
Block a user