mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
Separated gen3 and shinuchi scores into their own DBs
This commit is contained in:
@@ -165,7 +165,7 @@ class SongBox(BaseBox):
|
||||
self.text_loaded = True
|
||||
|
||||
def get_scores(self):
|
||||
with sqlite3.connect('scores.db') as con:
|
||||
with sqlite3.connect(global_data.score_db) as con:
|
||||
cursor = con.cursor()
|
||||
# Batch database query for all diffs at once
|
||||
if self.tja.metadata.course_data:
|
||||
|
||||
@@ -14,6 +14,9 @@ class PlayerNum(IntEnum):
|
||||
TWO_PLAYER = 3
|
||||
DAN = 4
|
||||
|
||||
class ScoreMethod():
|
||||
GEN3 = "gen3"
|
||||
SHINUCHI = "shinuchi"
|
||||
|
||||
class Difficulty(IntEnum):
|
||||
EASY = 0
|
||||
@@ -154,6 +157,7 @@ class GlobalData:
|
||||
config: Config = field(default_factory=dict)
|
||||
song_hashes: dict[str, list[dict]] = field(default_factory=lambda: dict()) #Hash to path
|
||||
song_paths: dict[Path, str] = field(default_factory=lambda: dict()) #path to hash
|
||||
score_db: str = ""
|
||||
song_progress: float = 0.0
|
||||
total_songs: int = 0
|
||||
hit_sound: list[int] = field(default_factory=lambda: [0, 0, 0])
|
||||
|
||||
@@ -27,14 +27,14 @@ class DiffHashesDecoder(json.JSONDecoder):
|
||||
super().__init__(object_hook=diff_hashes_object_hook, *args, **kwargs)
|
||||
|
||||
def get_db_version():
|
||||
with sqlite3.connect('scores.db') as con:
|
||||
with sqlite3.connect(global_data.score_db) as con:
|
||||
cursor = con.cursor()
|
||||
cursor.execute('PRAGMA user_version')
|
||||
version = cursor.fetchone()[0]
|
||||
return version
|
||||
|
||||
def update_db_version():
|
||||
with sqlite3.connect('scores.db') as con:
|
||||
with sqlite3.connect(global_data.score_db) as con:
|
||||
cursor = con.cursor()
|
||||
cursor.execute(f'PRAGMA user_version = {DB_VERSION}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user