feat: 在 ScoreSaber 记录输出中添加歌曲 ID 信息
This commit is contained in:
parent
5750128f60
commit
78afc9005f
@ -123,23 +123,23 @@ type RecordDataLite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r RecordDataLite) ToString() string {
|
func (r RecordDataLite) ToString() string {
|
||||||
formatedStrRanked := "%s,%s 使用 %s 在 %s 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。"
|
formatedStrRanked := "%s,%s 使用 %s 在 %s(%s) 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。"
|
||||||
formatedStrUnranked := "%s, %s 使用 %s 在 %s 的 %s 难度中打到了全球排名第%d,准度为 %s。"
|
formatedStrUnranked := "%s, %s 使用 %s 在 %s(%s) 的 %s 难度中打到了全球排名第%d,准度为 %s。"
|
||||||
formatedStrWithoutDevice := "%s, %s 在 %s 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。"
|
formatedStrWithoutDevice := "%s, %s 在 %s(%s) 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。"
|
||||||
formatedStrWithoutDeviceAndRank := "%s, %s 在 %s 的 %s 难度中打到了全球排名第%d,准度为 %s。"
|
formatedStrWithoutDeviceAndRank := "%s, %s 在 %s(%s) 的 %s 难度中打到了全球排名第%d,准度为 %s。"
|
||||||
hardStr := strings.Split(r.DifficultyRaw, "_")[1]
|
hardStr := strings.Split(r.DifficultyRaw, "_")[1]
|
||||||
layout := "2006-01-02 15:04:05.999999999-07:00"
|
layout := "2006-01-02 15:04:05.999999999-07:00"
|
||||||
parsedTime, _ := time.Parse(layout, r.GeneratedTime)
|
parsedTime, _ := time.Parse(layout, r.GeneratedTime)
|
||||||
duration := time.Since(parsedTime)
|
duration := time.Since(parsedTime)
|
||||||
timeStr := timeConvert(duration)
|
timeStr := timeConvert(duration)
|
||||||
if r.Stars == 0 && r.DeviceHmd != "" {
|
if r.Stars == 0 && r.DeviceHmd != "" {
|
||||||
return fmt.Sprintf(formatedStrUnranked, timeStr, r.Name, r.DeviceHmd, r.SongName, hardStr, r.Rank, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
return fmt.Sprintf(formatedStrUnranked, timeStr, r.Name, r.DeviceHmd, r.SongName, r.SongId, hardStr, r.Rank, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
||||||
} else if r.Stars != 0 && r.DeviceHmd != "" {
|
} else if r.Stars != 0 && r.DeviceHmd != "" {
|
||||||
return fmt.Sprintf(formatedStrRanked, timeStr, r.Name, r.DeviceHmd, r.SongName, hardStr, r.Stars, r.Rank, r.PP, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
return fmt.Sprintf(formatedStrRanked, timeStr, r.Name, r.DeviceHmd, r.SongName, r.SongId, hardStr, r.Stars, r.Rank, r.PP, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
||||||
} else if r.Stars != 0 && r.DeviceHmd == "" {
|
} else if r.Stars != 0 && r.DeviceHmd == "" {
|
||||||
return fmt.Sprintf(formatedStrWithoutDevice, timeStr, r.Name, r.SongName, hardStr, r.Stars, r.Rank, r.PP, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
return fmt.Sprintf(formatedStrWithoutDevice, timeStr, r.Name, r.SongName, r.SongId, hardStr, r.Stars, r.Rank, r.PP, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf(formatedStrWithoutDeviceAndRank, timeStr, r.Name, r.SongName, hardStr, r.Rank, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
return fmt.Sprintf(formatedStrWithoutDeviceAndRank, timeStr, r.Name, r.SongName, r.SongId, hardStr, r.Rank, fmt.Sprintf("%.2f%%", float64(r.Score)/float64(r.MaxScore)*100))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user