api: add possiblyInaccurateData field to show if the history for that day could be inaccurate
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Failing after 30s

This commit is contained in:
Lee 2024-08-05 04:58:46 +01:00
parent ba24eabfaa
commit 68ce2ff240
2 changed files with 20 additions and 0 deletions

View File

@ -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.
* <p>
* 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
* </p>
*
* @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.
*/

View File

@ -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) {