Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default async (req, res) => {
hide_rank,
show_icons,
include_all_commits,
count_private,
commits_year,
line_height,
title_color,
Expand Down Expand Up @@ -94,6 +95,7 @@ export default async (req, res) => {
showStats.includes("discussions_started"),
showStats.includes("discussions_answered"),
parseInt(commits_year, 10),
parseBoolean(count_private),
);
const cacheSeconds = resolveCacheSeconds({
requested: parseInt(cache_seconds, 10),
Expand Down
5 changes: 5 additions & 0 deletions src/fetchers/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const GRAPHQL_STATS_QUERY = `
login
commits: contributionsCollection (from: $startTime) {
totalCommitContributions,
restrictedContributionsCount,
}
reviews: contributionsCollection {
totalPullRequestReviewContributions
Expand Down Expand Up @@ -232,6 +233,7 @@ const fetchStats = async (
include_discussions = false,
include_discussions_answers = false,
commits_year,
count_private = false,
) => {
if (!username) {
throw new MissingParamError(["username"]);
Expand Down Expand Up @@ -290,6 +292,9 @@ const fetchStats = async (
stats.totalCommits = await totalCommitsFetcher(username);
} else {
stats.totalCommits = user.commits.totalCommitContributions;
if (count_private) {
stats.totalCommits += user.commits.restrictedContributionsCount;
}
}

stats.totalPRs = user.pullRequests.totalCount;
Expand Down