mai2: add rivals support

This commit is contained in:
Kevin Trocolli
2024-06-08 21:25:48 -04:00
parent 123ec99a97
commit eccbd1ad81
2 changed files with 62 additions and 4 deletions

View File

@@ -319,16 +319,16 @@ class Mai2ScoreData(BaseData):
sql = best_score.select(
and_(
best_score.c.user == user_id,
(best_score.c.song_id == song_id) if song_id is not None else True,
(best_score.c.musicId == song_id) if song_id is not None else True,
)
)
).order_by(best_score.c.musicId).order_by(best_score.c.level)
else:
sql = best_score_old.select(
and_(
best_score_old.c.user == user_id,
(best_score_old.c.song_id == song_id) if song_id is not None else True,
(best_score_old.c.musicId == song_id) if song_id is not None else True,
)
)
).order_by(best_score.c.musicId).order_by(best_score.c.level)
result = await self.execute(sql)
if result is None: