mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: exclude unknown languages from leaderboard time
This commit is contained in:
parent
a20456bb8e
commit
dc4eefbede
@ -223,11 +223,13 @@ func (srv *LeaderboardService) GenerateByUser(user *models.User, interval *model
|
|||||||
return nil, err
|
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{
|
return &models.LeaderboardItem{
|
||||||
User: user,
|
User: user,
|
||||||
UserID: user.ID,
|
UserID: user.ID,
|
||||||
Interval: (*interval)[0],
|
Interval: (*interval)[0],
|
||||||
Total: summary.TotalTime(),
|
Total: total,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user