2015-09-20 14:04:02 -06:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import lila.app._
|
|
|
|
import views._
|
|
|
|
|
|
|
|
object Stat extends LilaController {
|
|
|
|
|
|
|
|
def ratingDistribution(perfKey: lila.rating.Perf.Key) = Open { implicit ctx =>
|
2015-12-25 23:52:06 -07:00
|
|
|
lila.rating.PerfType(perfKey).filter(lila.rating.PerfType.isGame) match {
|
2016-02-21 20:20:01 -07:00
|
|
|
case Some(perfType) => Env.user.cached.ratingDistribution(perfType) map { data =>
|
2015-09-20 14:04:02 -06:00
|
|
|
Ok(html.stat.ratingDistribution(perfType, data))
|
|
|
|
}
|
|
|
|
case _ => notFound
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|