GitHubContributors

This commit is contained in:
Marcel Wege
2017-06-22 16:56:35 +02:00
parent f2d9cc0c0b
commit 5e51dad445
@@ -67,18 +67,12 @@ namespace OurUmbraco.Community.Controllers
// filter to only include items from the last year
var filteredRange = DateTime.UtcNow.AddYears(-1).Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
var contribWeeks = contrib.Weeks.Where(x => x.W >= filteredRange);
foreach (var contrib in gitHubContributors)
{
int add = 0, del = 0, total = 0;
foreach (var wk in contrib.Weeks.Where(x => x.W >= filteredRange))
{
add += wk.A;
del += wk.D;
total += wk.C;
}
contrib.Total = total;
contrib.TotalAdditions = add;
contrib.TotalDeletions = del;
contrib.Total = contrib.w;
contrib.TotalAdditions = contribWeeks.Sum(x=>x.A);
contrib.TotalDeletions = contribWeeks.Sum(x=>x.D);
}
var filteredContributors = gitHubContributors