From dc4eefbedeb16f68c5fa7ec87ac69b740f287a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Sun, 9 Apr 2023 17:35:55 +0200 Subject: [PATCH] fix: exclude unknown languages from leaderboard time --- services/leaderboard.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/leaderboard.go b/services/leaderboard.go index abb94a9..14783cb 100644 --- a/services/leaderboard.go +++ b/services/leaderboard.go @@ -223,11 +223,13 @@ func (srv *LeaderboardService) GenerateByUser(user *models.User, interval *model return nil, err } + // exclude unknown language (will also exclude browsing time by chrome-wakatime plugin) + total := summary.TotalTime() - summary.TotalTimeByKey(models.SummaryLanguage, models.UnknownSummaryKey) return &models.LeaderboardItem{ User: user, UserID: user.ID, Interval: (*interval)[0], - Total: summary.TotalTime(), + Total: total, }, nil }