From 68ce2ff240d7d030d521b5d1ec3baf8ec1720c24 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 5 Aug 2024 04:58:46 +0100 Subject: [PATCH] api: add possiblyInaccurateData field to show if the history for that day could be inaccurate --- .../model/user/history/HistoryPoint.java | 19 +++++++++++++++++++ .../platform/impl/ScoreSaberPlatform.java | 1 + 2 files changed, 20 insertions(+) diff --git a/API/src/main/java/cc/fascinated/model/user/history/HistoryPoint.java b/API/src/main/java/cc/fascinated/model/user/history/HistoryPoint.java index 3028da2..ec7273a 100644 --- a/API/src/main/java/cc/fascinated/model/user/history/HistoryPoint.java +++ b/API/src/main/java/cc/fascinated/model/user/history/HistoryPoint.java @@ -53,6 +53,25 @@ public class HistoryPoint { */ private Integer rankedPlayCount = 0; + /** + * Whether the data for this day is possibly inaccurate. + */ + private Boolean possiblyInaccurateData; + + /** + * Gets whether the data for this day is possibly inaccurate. + *

+ * eg: the user isn't having their data tracked every day + * by us, only when they set a score + * This will only affect rank, countryRank, and pp + *

+ * + * @return true if the data is possibly inaccurate, false otherwise + */ + public Boolean getPossiblyInaccurateData() { + return possiblyInaccurateData == null || possiblyInaccurateData; + } + /** * Increment the total ranked play count for this day. */ 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 f52c784..de08558 100644 --- a/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java +++ b/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java @@ -152,6 +152,7 @@ public class ScoreSaberPlatform extends Platform { history.setPp(account.getPp()); history.setRank(account.getRank()); history.setCountryRank(account.getCountryRank()); + history.setPossiblyInaccurateData(false); } // If the player didn't set any scores today, we need to set these values if (history.getTotalPlayCount() == null || history.getTotalRankedPlayCount() == null || history.getTotalUnrankedPlayCount() == null) {