From ba24eabfaa5fa3c601c60d2011f4d80e13aba0f3 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 5 Aug 2024 04:32:06 +0100 Subject: [PATCH] api: since we have this, might aswell track it, but it won't be be accurate if they ether: don't set a score that day, or only set 1 score in the morning, but it's better than no data for that day --- API/src/main/java/cc/fascinated/services/UserService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/API/src/main/java/cc/fascinated/services/UserService.java b/API/src/main/java/cc/fascinated/services/UserService.java index 02e5515..b86e98e 100644 --- a/API/src/main/java/cc/fascinated/services/UserService.java +++ b/API/src/main/java/cc/fascinated/services/UserService.java @@ -5,6 +5,7 @@ import cc.fascinated.exception.impl.BadRequestException; import cc.fascinated.model.token.ScoreSaberAccountToken; import cc.fascinated.model.user.ScoreSaberAccount; import cc.fascinated.model.user.User; +import cc.fascinated.model.user.history.HistoryPoint; import cc.fascinated.repository.UserRepository; import lombok.NonNull; import lombok.extern.log4j.Log4j2; @@ -80,6 +81,11 @@ public class UserService { ScoreSaberAccountToken accountToken = scoreSaberService.getAccount(user); user.setScoresaberAccount(ScoreSaberAccount.getFromToken(accountToken)); // Update the ScoreSaber account user.setUsername(accountToken.getName()); // Update the username + + HistoryPoint historyToday = user.getHistory().getTodayHistory(); + historyToday.setRank(accountToken.getRank()); + historyToday.setCountryRank(accountToken.getCountryRank()); + historyToday.setPp(accountToken.getPp()); } catch (Exception ex) { log.error("Failed to update ScoreSaber account for '{}'", steamId, ex); }