mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 20:36:26 +00:00
wip: arcaea-offline==0.2.0
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from arcaea_offline.database import Database
|
||||
from arcaea_offline.models import Chart, Score
|
||||
from arcaea_offline.models import Score
|
||||
from arcaea_offline_ocr.b30.chieri.v4.ocr import ChieriBotV4Ocr
|
||||
from arcaea_offline_ocr.b30.shared import B30OcrResultItem
|
||||
from PySide6.QtGui import QImage
|
||||
@ -27,25 +27,26 @@ class ChieriV4OcrRunnable(OcrRunnable):
|
||||
self.signals.finished.emit()
|
||||
|
||||
|
||||
def b30ResultToScoreInsert(_, qImage: QImage, result: B30OcrResultItem):
|
||||
def b30ResultToScore(_: None, qImage: QImage, result: B30OcrResultItem):
|
||||
if not result.song_id and not result.title:
|
||||
raise ValueError("no title or song_id")
|
||||
|
||||
db = Database()
|
||||
if not result.song_id:
|
||||
song_id = db.fuzzy_search_song_id(result.title)[0][0]
|
||||
raise NotImplementedError("Not supported yet.")
|
||||
else:
|
||||
song_id = result.song_id
|
||||
|
||||
chart = Chart.from_db_row(db.get_chart(song_id, result.rating_class))
|
||||
score = ScoreInsert(
|
||||
chart = db.get_chart(song_id, result.rating_class)
|
||||
score = Score(
|
||||
song_id=song_id,
|
||||
rating_class=result.rating_class,
|
||||
score=result.score,
|
||||
time=1485014400,
|
||||
date=None,
|
||||
pure=result.pure,
|
||||
far=result.far,
|
||||
lost=result.lost,
|
||||
comment="B30 OCR",
|
||||
)
|
||||
|
||||
return (chart, score)
|
||||
|
Reference in New Issue
Block a user