[O] Correctly compute rating change

pull/108/head
Azalea 2025-01-11 12:39:14 -05:00
parent 4a71e15fd5
commit d14998565b
1 changed files with 7 additions and 0 deletions

View File

@ -82,6 +82,13 @@
})
}
// Set beforeRating in recent to the last play's afterRating
user.recent.forEach((it, i) => {
if (i < user.recent.length - 1) {
it.beforeRating = user.recent[i + 1].afterRating
}
})
const minDate = moment().subtract(TREND_DAYS, 'days').format("YYYY-MM-DD")
d = {user,
trend: trend.filter(it => it.date >= minDate && it.plays != 0),