From a1e1bb500bb1adbef43add3a2319597c3ff90388 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 7 Oct 2022 13:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20metadata=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=B8=8D=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + metadata/genshin.py | 3 ++- plugins/{genshin => system}/refresh_metadata.py | 0 3 files changed, 3 insertions(+), 1 deletion(-) rename plugins/{genshin => system}/refresh_metadata.py (100%) diff --git a/.gitignore b/.gitignore index 0212f8db..5bb6dfdb 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ logs/ report/ /resources/*/*/test/ plugins/genshin/daily/daily.json +metadata/data/ resources/assets/ ### DotEnv ### diff --git a/metadata/genshin.py b/metadata/genshin.py index 52fed834..dae67322 100644 --- a/metadata/genshin.py +++ b/metadata/genshin.py @@ -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 {} diff --git a/plugins/genshin/refresh_metadata.py b/plugins/system/refresh_metadata.py similarity index 100% rename from plugins/genshin/refresh_metadata.py rename to plugins/system/refresh_metadata.py