diff --git a/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java b/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java index 7a11ba4..f52c784 100644 --- a/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java +++ b/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java @@ -145,10 +145,10 @@ public class ScoreSaberPlatform extends Platform { @Override public void trackPlayerMetrics() { Date date = DateUtils.getMidnightToday(); - for (User user : this.userService.getUsers(false)) { + for (User user : this.userService.getUsers(true)) { HistoryPoint history = user.getHistory().getHistoryForDate(date); if (user.isLinkedAccount()) { // Check if the user has linked their account - ScoreSaberAccountToken account = scoreSaberService.getAccount(user); // Get the account from the ScoreSaber API + ScoreSaberAccountToken account = this.scoreSaberService.getAccount(user); // Get the account from the ScoreSaber API history.setPp(account.getPp()); history.setRank(account.getRank()); history.setCountryRank(account.getCountryRank()); diff --git a/API/src/main/java/cc/fascinated/repository/UserRepository.java b/API/src/main/java/cc/fascinated/repository/UserRepository.java index 7918dbb..e2f17a9 100644 --- a/API/src/main/java/cc/fascinated/repository/UserRepository.java +++ b/API/src/main/java/cc/fascinated/repository/UserRepository.java @@ -25,8 +25,8 @@ public interface UserRepository extends MongoRepository { * * @return the list of users */ - @Query(value = "{}", fields = "{ 'steamId' : 1 }") - List fetchOnlySteamIds(); + @Query(value = "{}", fields = "{ 'steamId' : 1, linkedAccount: 1 }") + List fetchAccountsSimple(); /** * Finds a user by their username. diff --git a/API/src/main/java/cc/fascinated/services/UserService.java b/API/src/main/java/cc/fascinated/services/UserService.java index 87fafed..02e5515 100644 --- a/API/src/main/java/cc/fascinated/services/UserService.java +++ b/API/src/main/java/cc/fascinated/services/UserService.java @@ -105,9 +105,9 @@ public class UserService { * * @return all users */ - public List getUsers(boolean steamIdsOnly) { - if (steamIdsOnly) { - return this.userRepository.fetchOnlySteamIds(); + public List getUsers(boolean smallerAccount) { + if (smallerAccount) { + return this.userRepository.fetchAccountsSimple(); } return this.userRepository.findAll(); }