only consider stable ratings in ranking calculation

This commit is contained in:
Thibault Duplessis 2014-03-13 09:05:35 +01:00
parent bffa53ba10
commit ccd7703883

View file

@ -18,7 +18,7 @@ private[user] final class Ranking(ttl: Duration) {
private def compute: Fu[Map[String, Int]] =
$primitive(
UserRepo.enabledSelect ++ Json.obj("rating" -> $gt(Glicko.default.intRating)),
UserRepo.stableGoodLadSelect ++ Json.obj("rating" -> $gt(Glicko.default.intRating)),
"_id",
_ sort UserRepo.sortRatingDesc
)(_.asOpt[String]) map { _.zipWithIndex.map(x => x._1 -> (x._2 + 1)).toMap }