From 78afc9005f13f20e4007d3bf45447f15fcd1f1ba Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Sat, 8 Mar 2025 20:42:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=20ScoreSaber=20=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=BE=93=E5=87=BA=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=20ID=20=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/scoresaber/model.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/service/scoresaber/model.go b/service/scoresaber/model.go index 37ee014..ed792c5 100644 --- a/service/scoresaber/model.go +++ b/service/scoresaber/model.go @@ -123,23 +123,23 @@ type RecordDataLite struct { } func (r RecordDataLite) ToString() string { - formatedStrRanked := "%s,%s 使用 %s 在 %s 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。" - formatedStrUnranked := "%s, %s 使用 %s 在 %s 的 %s 难度中打到了全球排名第%d,准度为 %s。" - formatedStrWithoutDevice := "%s, %s 在 %s 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。" - formatedStrWithoutDeviceAndRank := "%s, %s 在 %s 的 %s 难度中打到了全球排名第%d,准度为 %s。" + formatedStrRanked := "%s,%s 使用 %s 在 %s(%s) 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。" + formatedStrUnranked := "%s, %s 使用 %s 在 %s(%s) 的 %s 难度中打到了全球排名第%d,准度为 %s。" + formatedStrWithoutDevice := "%s, %s 在 %s(%s) 的 %s 难度(%.1f🌟)中打到了全球排名第%d,pp 为 %.2f,准度为 %s。" + formatedStrWithoutDeviceAndRank := "%s, %s 在 %s(%s) 的 %s 难度中打到了全球排名第%d,准度为 %s。" hardStr := strings.Split(r.DifficultyRaw, "_")[1] layout := "2006-01-02 15:04:05.999999999-07:00" parsedTime, _ := time.Parse(layout, r.GeneratedTime) duration := time.Since(parsedTime) timeStr := timeConvert(duration) 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 != "" { - 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 == "" { - 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 { - 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)) } }