feat: 优化 BeatLeader 和 ScoreSaber 数据查询逻辑,新增数据变更检测方法

This commit is contained in:
lixiangwuxian
2025-03-08 19:01:47 +08:00
parent fcc99efe7e
commit b0892412ce
5 changed files with 96 additions and 53 deletions

View File

@@ -181,7 +181,7 @@ func (ss *ssQuery) GetScore(ssId string) (reply string, err error) {
}
// 如果有新的数据,则插入
if lastDataLite.TotalPlayCount != dataLite.TotalPlayCount {
if lastDataLite.IsDiffFrom(dataLite) {
_, err = tx.NamedExec(`INSERT INTO ssData (id, name, country, pp, rank, country_rank, total_score,
total_ranked_score, average_ranked_accuracy, total_play_count, ranked_play_count, replays_watched, generated_time)
VALUES (:id, :name, :country, :pp, :rank, :country_rank, :total_score,