更新资源map;本地存在资源时不再获取节点加快响应;fix#91

This commit is contained in:
UCPr 2025-01-23 15:44:33 +08:00
parent 2e8aea4542
commit a62109a6c0
11 changed files with 21 additions and 17 deletions

View file

@ -37,6 +37,9 @@ export const downloadResourceImage = async (
) => {
localBase = LocalURI[localBase];
const finalPath = path.join(localBase, filename);
if (fs.existsSync(finalPath) && fs.statSync(finalPath).size > 0) {
return finalPath;
}
const url = await getResourceRemotePath(remoteLabel, filename);
let result = await checkFile(url, finalPath);
if (!result && !!replaceFilename) {