impr: fallback when no chart data in database

This commit is contained in:
2023-09-23 14:53:04 +08:00
parent 109e635347
commit 0bd709f49e
6 changed files with 77 additions and 25 deletions

View File

@ -85,4 +85,11 @@ class ScoreConverter:
comment=f"OCR {QFileInfo(imagePath).fileName()}",
)
chart = db.get_chart(score.song_id, score.rating_class)
if not chart:
chart = Chart(
song_id=result.song_id,
rating_class=result.rating_class,
title=result.song_id,
constant=0.0,
)
return (chart, score)