New weighting for the explore page

This commit is contained in:
Eduard Urbach 2017-10-02 01:30:50 +02:00
parent b0c70fc735
commit 531a502721

View File

@ -8,10 +8,11 @@ import (
) )
const ( const (
currentlyAiringBonus = 4.0 currentlyAiringBonus = 5.0
popularityThreshold = 5 popularityThreshold = 5
popularityPenalty = 4.0 popularityPenalty = 8.0
watchingPopularityWeight = 0.2 watchingPopularityWeight = 0.3
plannedPopularityWeight = 0.2
) )
func main() { func main() {
@ -50,6 +51,9 @@ func main() {
scoreA += float64(a.Popularity.Watching) * watchingPopularityWeight scoreA += float64(a.Popularity.Watching) * watchingPopularityWeight
scoreB += float64(b.Popularity.Watching) * watchingPopularityWeight scoreB += float64(b.Popularity.Watching) * watchingPopularityWeight
scoreA += float64(a.Popularity.Planned) * plannedPopularityWeight
scoreB += float64(b.Popularity.Planned) * plannedPopularityWeight
return scoreA > scoreB return scoreA > scoreB
}) })