Compare commits

..

No commits in common. "c1f83eff55c28e07f418cde213c91d2b14fa61ec" and "3867b273c7373a6f74b44058b417612a838a3033" have entirely different histories.

View File

@ -259,14 +259,6 @@ class Database(metaclass=Singleton):
result = session.scalar(stmt)
return result
def get_score_best(self, song_id: str, rating_class: int):
stmt = select(ScoreBest).where(
(ScoreBest.song_id == song_id) & (ScoreBest.rating_class == rating_class)
)
with self.sessionmaker() as session:
result = session.scalar(stmt)
return result
def insert_score(self, score: Score):
with self.sessionmaker() as session:
session.add(score)
@ -291,7 +283,7 @@ class Database(metaclass=Singleton):
session.delete(score)
session.commit()
def recommend_charts(self, play_result: float, bounds: float = 0.1):
def recommend_charts(self, play_result: float):
base_constant = math.ceil(play_result * 10)
results = []
@ -314,8 +306,6 @@ class Database(metaclass=Singleton):
(ScoreBest.song_id == chart.song_id)
& (ScoreBest.rating_class == chart.rating_class)
& (ScoreBest.score >= min_score)
& (play_result - bounds < ScoreBest.potential)
& (ScoreBest.potential < play_result + bounds)
)
if session.scalar(score_best_stmt):
chart_id = f"{chart.song_id},{chart.rating_class}"