mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-07-01 12:16:26 +00:00
refactor(models)!: Score
& ChartInfo
column changed
This commit is contained in:
22
src/arcaea_offline/external/arcaea/st3.py
vendored
22
src/arcaea_offline/external/arcaea/st3.py
vendored
@ -12,8 +12,6 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class St3ScoreParser(ArcaeaParser):
|
||||
CLEAR_TYPES_MAP = {0: -1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1}
|
||||
|
||||
def __init__(self, filepath):
|
||||
super().__init__(filepath)
|
||||
|
||||
@ -22,14 +20,22 @@ class St3ScoreParser(ArcaeaParser):
|
||||
with sqlite3.connect(self.filepath) as st3_conn:
|
||||
cursor = st3_conn.cursor()
|
||||
db_scores = cursor.execute(
|
||||
"SELECT songId, songDifficulty, score, perfectCount, nearCount, missCount, date FROM scores"
|
||||
"SELECT songId, songDifficulty, score, perfectCount, nearCount, missCount, date, modifier FROM scores"
|
||||
).fetchall()
|
||||
for song_id, rating_class, score, pure, far, lost, date in db_scores:
|
||||
db_clear_type = cursor.execute(
|
||||
for (
|
||||
song_id,
|
||||
rating_class,
|
||||
score,
|
||||
pure,
|
||||
far,
|
||||
lost,
|
||||
date,
|
||||
modifier,
|
||||
) in db_scores:
|
||||
clear_type = cursor.execute(
|
||||
"SELECT clearType FROM cleartypes WHERE songId = ? AND songDifficulty = ?",
|
||||
(song_id, rating_class),
|
||||
).fetchone()[0]
|
||||
r10_clear_type = self.CLEAR_TYPES_MAP[db_clear_type]
|
||||
|
||||
date_str = str(date)
|
||||
date = None if len(date_str) < 7 else int(date_str.ljust(10, "0"))
|
||||
@ -43,7 +49,9 @@ class St3ScoreParser(ArcaeaParser):
|
||||
far=far,
|
||||
lost=lost,
|
||||
date=date,
|
||||
r10_clear_type=r10_clear_type,
|
||||
modifier=modifier,
|
||||
clear_type=clear_type,
|
||||
comment="Imported from st3",
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -22,7 +22,7 @@ class ArcsongDbParser:
|
||||
song_id=result[0],
|
||||
rating_class=result[1],
|
||||
constant=result[2],
|
||||
note=result[3] or None,
|
||||
notes=result[3] or None,
|
||||
)
|
||||
results.append(chart)
|
||||
|
||||
|
@ -108,7 +108,7 @@ class ArcSongJsonBuilder:
|
||||
"version": difficulty.version or song.version or "",
|
||||
"difficulty": difficulty.rating * 2 + int(difficulty.rating_plus),
|
||||
"rating": chart_info.constant or 0 if chart_info else 0,
|
||||
"note": chart_info.note or 0 if chart_info else 0,
|
||||
"note": chart_info.notes or 0 if chart_info else 0,
|
||||
"chart_designer": difficulty.chart_designer or "",
|
||||
"jacket_designer": difficulty.jacket_desginer or "",
|
||||
"jacket_override": difficulty.jacket_override,
|
||||
|
Reference in New Issue
Block a user