上传文件至 /

This commit is contained in:
2025-10-13 18:15:05 +08:00
parent 2a198c3da6
commit c4e2150acf
18 changed files with 1178 additions and 1 deletions

19
MusicDB.py Normal file
View File

@@ -0,0 +1,19 @@
import rapidjson as json
from Config import *
from typing import Dict, Union
MusicDBType = Dict[int, Dict[str, Union[int, str]]]
__all__ = ['musicDB']
try:
with open(musicDBPath, 'r', encoding='utf-8') as f:
data = json.load(f)
except FileNotFoundError:
try:
with open(musicDBPathFallback, 'r', encoding='utf-8') as f:
data = json.load(f)
except:
raise FileNotFoundError("musicDB.json 文件不存在!")
musicDB: MusicDBType = {int(k): v for k, v in data.items()}