From a919ed91430f1c94c754f07e53bea8aa3afdc9f8 Mon Sep 17 00:00:00 2001 From: Redet Getachew Date: Sat, 22 Oct 2022 22:26:26 +0300 Subject: [PATCH] Adds download count to the release section #141 --- Website/script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Website/script.js b/Website/script.js index 9164bcfe0..8a40d71ad 100644 --- a/Website/script.js +++ b/Website/script.js @@ -181,11 +181,16 @@ function renderReleases(releases) { } function renderRelease(all, release) { - console.log(release); + release.totalCount = release.assets.reduce( + (total, rel) => total + rel.download_count, + 0 + ); let assets = renderAssets(release.assets.reverse()); return `${all}
${release.name}
-
${new Date(release.published_at)}
+
${new Date(release.published_at)} with ${ + release.totalCount + } Downloads
Learn More