fix: 再铲一屎

This commit is contained in:
status102
2025-05-13 00:02:47 +08:00
parent de0347d61d
commit b5d825845b
2 changed files with 10 additions and 2 deletions

View File

@@ -165,7 +165,15 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
LoadCacheWithoutRet(AvatarCacheManager, "avatars"_p);
// 重要的资源,实时加载(图片还是惰性的)
LoadResourceWithTemplAndCheckRet(TaskData, "tasks"_p, "template"_p);
if (std::filesystem::is_directory(path / "tasks"_p)) {
LoadResourceWithTemplAndCheckRet(TaskData, "tasks"_p, "template"_p);
}
else if (std::filesystem::is_regular_file(path / "tasks.json"_p)) {
Log.warn("================ DEPRECATED ================");
Log.warn(__FUNCTION__, "resource/tasks.json has been deprecated since");
Log.warn("================ DEPRECATED ================");
LoadResourceWithTemplAndCheckRet(TaskData, "tasks.json"_p, "template"_p);
} // v5.16.4
// 下面这几个资源都是会带OTA功能的路径不能动
LoadResourceWithTemplAndCheckRet(InfrastConfig, "infrast.json"_p, "template"_p / "infrast"_p);