exclude BOTs from "active players" leaderboard

pull/9293/head
Konstantinos07 2021-06-28 20:04:17 +03:00
parent 5b05c4a13f
commit c766c36651
1 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
val normalize = User normalize _
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)
@ -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.Troll.key)
)
val enabledNoBotSelect = $and(
$doc(F.enabled -> true),
$doc(F.title -> $ne(Title.BOT))
)
def stablePerfSelect(perf: String) =
$doc(s"perfs.$perf.gl.d" -> $lt(lila.rating.Glicko.provisionalDeviation))
val patronSelect = $doc(s"${F.plan}.active" -> true)