impr(external): Andreal B30 overflow data

This commit is contained in:
283375 2023-10-21 20:58:40 +08:00
parent 7a64ec4a4a
commit d79c73df8c
Signed by: 283375
SSH Key Fingerprint: SHA256:UcX0qg6ZOSDOeieKPGokA5h7soykG61nz2uxuQgVLSk

View File

@ -84,11 +84,15 @@ class AndrealImageGeneratorApiDataConverter:
raise ValueError("No score available.")
best30_avg = self.session.scalar(select(CalculatedPotential.b30))
best30_overflow = (
[self.score(score) for score in scores[30:40]] if len(scores) > 30 else []
)
return {
"content": {
"account_info": self.account_info(),
"best30_avg": best30_avg,
"best30_list": [self.score(score) for score in scores[:30]],
"best30_overflow": [self.score(score) for score in scores[-10:]],
"best30_overflow": best30_overflow,
}
}