wip: arcaea-offline==0.2.0

- fix viewing/database read references of `ScoreInsert`
This commit is contained in:
2023-08-29 21:26:31 +08:00
parent accf547e90
commit a9d2b5f75d
8 changed files with 49 additions and 46 deletions

View File

@ -50,22 +50,22 @@ def getImageDate(imagePath: str) -> QDateTime:
return datetime
class ScoreInsertConverter:
class ScoreConverter:
@staticmethod
def deviceV2(imagePath: str, _, result: DeviceOcrResult) -> Tuple[Chart, Score]:
db = Database()
scoreInsert = ScoreInsert(
score = Score(
song_id=result.song_id,
rating_class=result.rating_class,
score=result.score,
pure=result.pure,
far=result.far,
lost=result.lost,
time=getImageDate(imagePath).toSecsSinceEpoch(),
date=getImageDate(imagePath).toSecsSinceEpoch(),
max_recall=result.max_recall,
clear_type=None,
r10_clear_type=None,
comment=f"OCR {QFileInfo(imagePath).fileName()}",
)
chart = Chart.from_db_row(
db.get_chart(scoreInsert.song_id, scoreInsert.rating_class)
)
return (chart, scoreInsert)
print(f"OCR {QFileInfo(imagePath).fileName()}")
chart = db.get_chart(score.song_id, score.rating_class)
return (chart, score)