fix: resolve mirror json generation logic issue

This commit is contained in:
daydreamer-json
2026-02-16 00:36:31 +09:00
parent d0e18b90d0
commit 9e1ca22395

View File

@@ -164,6 +164,12 @@ async function saveToGHMirror(url: string, name: string | null): Promise<void> {
})();
if (!mirrorFileDb.find((e) => e.orig.includes(stringUtils.removeQueryStr(url)))) {
await githubUtils.uploadAsset(octoClient, githubAuthCfg, url, name);
if (githubAuthCfg) {
mirrorFileDb.push({
orig: stringUtils.removeQueryStr(url),
mirror: `https://github.com/${githubAuthCfg.owner}/${githubAuthCfg.repo}/releases/download/${githubAuthCfg.tag}/${name ?? new URL(url).pathname.split('/').pop() ?? ''}`,
});
}
}
}