fix: 优化 BeatLeader 歌曲 ID 处理逻辑,增加健壮性
This commit is contained in:
parent
beb8562690
commit
f02b00fb6a
@ -354,7 +354,7 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er
|
|||||||
SongSubName: score.Leaderboard.Song.SubName,
|
SongSubName: score.Leaderboard.Song.SubName,
|
||||||
SongAuthorName: score.Leaderboard.Song.Author,
|
SongAuthorName: score.Leaderboard.Song.Author,
|
||||||
SongHash: score.Leaderboard.Song.Hash,
|
SongHash: score.Leaderboard.Song.Hash,
|
||||||
SongId: score.Leaderboard.Song.ID[0:5],
|
SongId: "",
|
||||||
CoverImage: score.Leaderboard.Song.CoverImage,
|
CoverImage: score.Leaderboard.Song.CoverImage,
|
||||||
DifficultyRaw: score.Leaderboard.Difficulty.DifficultyName,
|
DifficultyRaw: score.Leaderboard.Difficulty.DifficultyName,
|
||||||
PP: score.Pp,
|
PP: score.Pp,
|
||||||
@ -372,6 +372,11 @@ func (bl *blQuery) GetRecentScores(count int, qqId string) ([]RecordDataLite, er
|
|||||||
DeviceControllerRight: GetControllerStr(score.Controller),
|
DeviceControllerRight: GetControllerStr(score.Controller),
|
||||||
GeneratedTime: time.Unix(score.Timepost, 0).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.Song.ID != "" && len(score.Leaderboard.Song.ID) > 5 {
|
||||||
|
dataLite.SongId = score.Leaderboard.Song.ID[0:5]
|
||||||
|
} else if score.Leaderboard.Song.ID != "" {
|
||||||
|
dataLite.SongId = score.Leaderboard.Song.ID
|
||||||
|
}
|
||||||
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