mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-17 21:30:18 +00:00
wip(db)!
This commit is contained in:
parent
920e2bda98
commit
da693954e3
@ -75,6 +75,7 @@ INIT_SQLS: Dict[int, VersionSqls] = {
|
||||
"""
|
||||
CREATE VIEW IF NOT EXISTS calculated AS
|
||||
SELECT
|
||||
scores.id,
|
||||
scores.song_id,
|
||||
scores.rating_class,
|
||||
scores.score,
|
||||
@ -96,8 +97,7 @@ INIT_SQLS: Dict[int, VersionSqls] = {
|
||||
LEFT JOIN charts ON scores.rating_class = charts.rating_class
|
||||
AND scores.song_id = charts.song_id
|
||||
GROUP BY
|
||||
scores.song_id,
|
||||
scores.rating_class
|
||||
scores.id
|
||||
""",
|
||||
"""
|
||||
CREATE VIEW IF NOT EXISTS bests AS
|
||||
|
@ -92,26 +92,30 @@ class Package:
|
||||
|
||||
@dataclass
|
||||
class DbScoreRow:
|
||||
id: int
|
||||
song_id: str
|
||||
rating_class: int
|
||||
score: int
|
||||
pure: int
|
||||
far: int
|
||||
lost: int
|
||||
pure: Optional[int]
|
||||
far: Optional[int]
|
||||
lost: Optional[int]
|
||||
time: int
|
||||
max_recall: Optional[int] = None
|
||||
max_recall: Optional[int]
|
||||
clear_type: Optional[int]
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
class Score:
|
||||
id: int
|
||||
song_id: str
|
||||
rating_class: int
|
||||
score: int
|
||||
pure: int
|
||||
far: int
|
||||
lost: int
|
||||
pure: Optional[int]
|
||||
far: Optional[int]
|
||||
lost: Optional[int]
|
||||
time: int
|
||||
max_recall: Optional[int] = None
|
||||
max_recall: Optional[int]
|
||||
clear_type: Optional[int]
|
||||
|
||||
@classmethod
|
||||
def from_db_row(cls, row: DbScoreRow):
|
||||
@ -125,31 +129,33 @@ class Score:
|
||||
|
||||
@dataclass
|
||||
class DbCalculatedRow:
|
||||
id: int
|
||||
song_id: str
|
||||
rating_class: int
|
||||
score: int
|
||||
pure: int
|
||||
far: int
|
||||
lost: int
|
||||
pure: Optional[int]
|
||||
far: Optional[int]
|
||||
lost: Optional[int]
|
||||
time: int
|
||||
rating: int
|
||||
note: int
|
||||
pure_small: int
|
||||
pure_small: Optional[int]
|
||||
potential: float
|
||||
|
||||
|
||||
@dataclass(kw_only=True)
|
||||
class Calculated:
|
||||
id: int
|
||||
song_id: str
|
||||
rating_class: int
|
||||
score: int
|
||||
pure: int
|
||||
far: int
|
||||
lost: int
|
||||
pure: Optional[int]
|
||||
far: Optional[int]
|
||||
lost: Optional[int]
|
||||
time: int
|
||||
rating: int
|
||||
note: int
|
||||
pure_small: int
|
||||
pure_small: Optional[int]
|
||||
potential: float
|
||||
|
||||
@classmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user