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) }