📝 新增gitea数据
Some checks failed
Deploy VitePress site to Pages / build (push) Failing after 1m27s

This commit is contained in:
snowykami 2024-09-02 21:28:08 +08:00
parent 1d0f0a2539
commit 5a2990770c

View File

@ -84,16 +84,16 @@ async function getGithubStats() {
}
async function getRepoStats() {
// 两个接口各数据,哪个大取哪个
// 两个接口各数据,加和返回
const githubStats = await getGithubStats();
const giteaStats = await getGiteaStats();
return {
stars: Math.max(githubStats.stars, giteaStats.stars),
forks: Math.max(githubStats.forks, giteaStats.forks),
watchers: Math.max(githubStats.watchers, giteaStats.watchers),
issues: Math.max(githubStats.issues, giteaStats.issues),
prs: Math.max(githubStats.prs, giteaStats.prs),
size: Math.max(githubStats.size, giteaStats.size),
stars: githubStats.stars + giteaStats.stars,
forks: githubStats.forks + giteaStats.forks,
watchers: githubStats.watchers + giteaStats.watchers,
issues: githubStats.issues + giteaStats.issues,
prs: githubStats.prs + giteaStats.prs,
size: githubStats.size + giteaStats.size,
};
}