mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🐛 修复 metadata 目录不存在
This commit is contained in:
parent
4c702515a0
commit
a1e1bb500b
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ logs/
|
||||
report/
|
||||
/resources/*/*/test/
|
||||
plugins/genshin/daily/daily.json
|
||||
metadata/data/
|
||||
resources/assets/
|
||||
|
||||
### DotEnv ###
|
||||
|
@ -15,13 +15,14 @@ __all__ = [
|
||||
]
|
||||
|
||||
data_dir = PROJECT_ROOT.joinpath('metadata/data/')
|
||||
data_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def _get_content(file_name: str) -> JSONType:
|
||||
path = data_dir.joinpath(file_name).with_suffix('.json')
|
||||
if not path.exists():
|
||||
logger.error(
|
||||
"暂未找到名为 \"{file_name}.json\" 的 metadata , 请先使用 [yellow bold]/refresh_metadata[/] 命令下载",
|
||||
f"暂未找到名为 \"{file_name}.json\" 的 metadata , 请先使用 [yellow bold]/refresh_metadata[/] 命令下载",
|
||||
extra={'markup': True}
|
||||
)
|
||||
return {}
|
||||
|
Loading…
Reference in New Issue
Block a user