From fc964903b7763477ade641fb3c14c7eb11de3d52 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 3 Dec 2017 16:06:20 +0100 Subject: [PATCH] Exclude planned anime from statistics --- pages/profile/stats.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/profile/stats.go b/pages/profile/stats.go index d13c1923..9e2b2f81 100644 --- a/pages/profile/stats.go +++ b/pages/profile/stats.go @@ -39,13 +39,18 @@ func GetStatsByUser(ctx *aero.Context) string { defer animeList.Unlock() for _, item := range animeList.Items { + status[item.Status]++ + + if item.Status == arn.AnimeListStatusPlanned { + continue + } + currentWatch := item.Episodes * item.Anime().EpisodeLength reWatch := item.RewatchCount * item.Anime().EpisodeCount * item.Anime().EpisodeLength duration := time.Duration(currentWatch + reWatch) userStats.AnimeWatchingTime += duration * time.Minute ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++ - status[item.Status]++ types[item.Anime().Type]++ for _, studio := range item.Anime().Studios() {