Fixes issue with contrib not counting commits but additions+deletions
This commit is contained in:
@@ -140,7 +140,6 @@ else
|
||||
<div class="col-md-12">
|
||||
<h1 class="text-center">GitHub Contributions</h1>
|
||||
<p>
|
||||
Contributions to Umbraco GitHub repositories
|
||||
<small class="link-list">
|
||||
Contributions to default branches for
|
||||
<a href="https://github.com/umbraco/Umbraco-CMS" target="_blank" title="Umbraco-CMS">Umbraco-CMS</a>,
|
||||
@@ -153,7 +152,7 @@ else
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<small>GitHub contributors</small>
|
||||
<small>Contributions the last 12 months (number indicating accepted commits)</small>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 flex forum-thread" id="github-contributors">
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OurUmbraco.Community.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// filter to only include items from the last year
|
||||
// filter to only include items from the last year (if we ran 4.6.1 we could have used ToUnixTimeSeconds())
|
||||
var filteredRange = DateTime.UtcNow.AddYears(-1).Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
|
||||
foreach (var contrib in gitHubContributors)
|
||||
@@ -73,7 +73,7 @@ namespace OurUmbraco.Community.Controllers
|
||||
var contribWeeks = contrib.Weeks.Where(x => x.W >= filteredRange).ToList();
|
||||
contrib.TotalAdditions = contribWeeks.Sum(x=>x.A);
|
||||
contrib.TotalDeletions = contribWeeks.Sum(x=>x.D);
|
||||
contrib.Total = contrib.TotalAdditions + contrib.TotalDeletions;
|
||||
contrib.Total = contribWeeks.Sum(x => x.C);
|
||||
}
|
||||
|
||||
var filteredContributors = gitHubContributors
|
||||
|
||||
Reference in New Issue
Block a user