json放行

This commit is contained in:
tianmo committed 2026-09-11 14:02:48 +08:00
1 parent 99d85a9e6d
commit ba0f48c543
6 files changed
+52 -15

No files matched your search

+3 -4
View File
@@ -188,13 +188,12 @@ async function generate({ src, dest, item, deferRefresh }) {
}
// manifest 只能按扩展名接管 JSON,不能按文件内容过滤。因此先做低成本内容判定:
// 普通 JSON 立即生成中性缩略图,不扫描资源库,也不启动后台补刷。
// 普通 JSON 不写 dest,不修改尺寸,也不启动资源扫描和后台补刷。
// 这样可以保留 Eagle 或其他 JSON 插件生成的缩略图,避免本插件的回退图覆盖它。
if (srcExt === '.json') {
const jsonKind = await classifyJsonBriefly(src);
if (jsonKind === 'other') {
log('普通 JSON,跳过 Spine 资源发现: ' + src);
await writeNeutralJsonPlaceholder(dest);
item.width = 400; item.height = 400;
log('普通 JSON,放行给 Eagle/其他 JSON 插件: ' + src);
return resolve(item);
}
}