From 97b8171bd958015b8a03741062cf92aa01382331 Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 31 Oct 2017 01:34:23 +0100 Subject: [PATCH] Update template.go --- templates/template.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/template.go b/templates/template.go index b27ccb75..d164d978 100644 --- a/templates/template.go +++ b/templates/template.go @@ -173,9 +173,14 @@ func userProfileBase(c *gin.Context, templateName string, userProfile *models.Us } else { _, userProfile.Torrents, nbTorrents, _ = search.ByQuery(c, 1, true, false, true) } + + var uploadedSize int64 + for _, torrent := range userProfile.Torrents { + uploadedSize += 64 + } variables.Set("UserProfile", userProfile) - variables.Set("NbTorrents", nbTorrents) + variables.Set("NbTorrents", []int64{int64(nbTorrents),uploadedSize}) Render(c, path.Join(SiteDir, "user", templateName), variables) }