chore: totally fix lint issues

This commit is contained in:
mokurin000
2025-07-29 17:07:34 +08:00
parent ae6a4d1cf4
commit cb599c5f35
11 changed files with 358 additions and 245 deletions

View File

@@ -6,17 +6,17 @@ from typing import Dict, Union
MusicDBType = Dict[int, Dict[str, Union[int, str]]]
# 将 '__all__' 用于模块导出声明
__all__ = ['musicDB']
__all__ = ["musicDB"]
# 读取并解析 JSON 文件
try:
with open(musicDBPath, 'r', encoding='utf-8') as f:
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:
with open(musicDBPathFallback, "r", encoding="utf-8") as f:
data = json.load(f)
except:
except Exception:
raise FileNotFoundError("musicDB.json 文件不存在!")
# 将 JSON 数据转换为指定格式的字典