mai2: fix GetUserMusicApi pagination

This commit is contained in:
Kevin Trocolli
2023-06-13 22:07:48 -04:00
parent a0b25e2b7b
commit 5ca16f2067
2 changed files with 22 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ from sqlalchemy.engine import Row
from sqlalchemy.dialects.mysql import insert
from core.data.schema import BaseData, metadata
from core.data import cached
best_score = Table(
"mai2_score_best",
@@ -190,6 +191,7 @@ class Mai2ScoreData(BaseData):
return None
return result.lastrowid
@cached(2)
def get_best_scores(self, user_id: int, song_id: int = None) -> Optional[List[Row]]:
sql = best_score.select(
and_(