Fix missing rank data on partial tracked days
All checks were successful
Deploy Backend / deploy (push) Successful in 3m2s
Deploy Website / deploy (push) Successful in 4m41s

This commit is contained in:
Lee 2024-10-17 07:15:12 +01:00
parent 7f5587546c
commit 118dc9d9f1

View File

@ -143,9 +143,10 @@ export async function getScoreSaberPlayerFromToken(
daysAgo += 1;
const dateKey = formatDateMinimal(date);
if (!statisticHistory[dateKey]) {
if (!statisticHistory[dateKey] || statisticHistory[dateKey].rank == undefined) {
missingDays += 1;
statisticHistory[dateKey] = {
...statisticHistory[dateKey],
rank: rank,
};
}