mirror of
https://github.com/daydreamer-json/ak-endfield-api-archive.git
synced 2026-03-22 07:12:28 +01:00
fix: resolve mirror json generation logic issue
This commit is contained in:
@@ -164,6 +164,12 @@ async function saveToGHMirror(url: string, name: string | null): Promise<void> {
|
|||||||
})();
|
})();
|
||||||
if (!mirrorFileDb.find((e) => e.orig.includes(stringUtils.removeQueryStr(url)))) {
|
if (!mirrorFileDb.find((e) => e.orig.includes(stringUtils.removeQueryStr(url)))) {
|
||||||
await githubUtils.uploadAsset(octoClient, githubAuthCfg, url, name);
|
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() ?? ''}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user