exclude BOTs from "active players" leaderboard

This commit is contained in:
Konstantinos07 2021-06-28 20:04:17 +03:00
parent 5b05c4a13f
commit c766c36651

View file

@ -22,7 +22,7 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
val normalize = User normalize _ val normalize = User normalize _
def topNbGame(nb: Int): Fu[List[User]] = def topNbGame(nb: Int): Fu[List[User]] =
coll.find(enabledSelect).sort($sort desc "count.game").cursor[User]().list(nb) coll.find(enabledNoBotSelect).sort($sort desc "count.game").cursor[User]().list(nb)
def byId(id: ID): Fu[Option[User]] = User.noGhost(id) ?? coll.byId[User](id) def byId(id: ID): Fu[Option[User]] = User.noGhost(id) ?? coll.byId[User](id)
@ -277,6 +277,10 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
$doc(F.marks -> UserMark.Boost.key), $doc(F.marks -> UserMark.Boost.key),
$doc(F.marks -> UserMark.Troll.key) $doc(F.marks -> UserMark.Troll.key)
) )
val enabledNoBotSelect = $and(
$doc(F.enabled -> true),
$doc(F.title -> $ne(Title.BOT))
)
def stablePerfSelect(perf: String) = def stablePerfSelect(perf: String) =
$doc(s"perfs.$perf.gl.d" -> $lt(lila.rating.Glicko.provisionalDeviation)) $doc(s"perfs.$perf.gl.d" -> $lt(lila.rating.Glicko.provisionalDeviation))
val patronSelect = $doc(s"${F.plan}.active" -> true) val patronSelect = $doc(s"${F.plan}.active" -> true)