code tweaks
This commit is contained in:
parent
115f8eb0ac
commit
6405fff999
|
@ -121,7 +121,6 @@ object User {
|
|||
def tvPeriod = new Period(tv * 1000l)
|
||||
def nonEmptyTvPeriod = (tv > 0) option tvPeriod
|
||||
}
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
implicit def playTimeHandler = reactivemongo.bson.Macros.handler[PlayTime]
|
||||
|
||||
// Matches a lichess username with an '@' prefix if it is used as a single
|
||||
|
|
|
@ -203,8 +203,8 @@ object UserRepo {
|
|||
case _ => none
|
||||
}) ifFalse ai
|
||||
).flatten.map(k => BSONElement(k, BSONInteger(1))) ::: List(
|
||||
totalTime map BSONInteger.apply map (v => BSONElement(s"${F.playTime}.total", v)),
|
||||
tvTime map BSONInteger.apply map (v => BSONElement(s"${F.playTime}.tv", v))
|
||||
totalTime map (v => BSONElement(s"${F.playTime}.total", BSONInteger(v))),
|
||||
tvTime map (v => BSONElement(s"${F.playTime}.tv", BSONInteger(v)))
|
||||
).flatten
|
||||
|
||||
coll.update($id(id), $inc(incs))
|
||||
|
|
Loading…
Reference in a new issue