sort API now playing games by priority
parent
f99557b702
commit
a938449718
|
@ -1,6 +1,6 @@
|
|||
@(povs: List[Pov])(implicit ctx: Context)
|
||||
|
||||
@povs.sortBy(Pov.priority).take(9).map { pov =>
|
||||
@povs.take(9).map { pov =>
|
||||
<a href="@routes.Round.player(pov.fullId)" class="@if(pov.isMyTurn){my_turn}">
|
||||
@gameFen(pov.game, pov.color, withLink = false, withTitle = false)
|
||||
<span class="meta">
|
||||
|
|
|
@ -117,9 +117,10 @@ object GameRepo {
|
|||
)))
|
||||
}
|
||||
|
||||
def nowPlaying(user: User): Fu[List[Pov]] = $find(Query nowPlaying user.id) map {
|
||||
_ flatMap { Pov(_, user) }
|
||||
}
|
||||
def nowPlaying(user: User): Fu[List[Pov]] =
|
||||
$find(Query nowPlaying user.id) map {
|
||||
_ flatMap { Pov(_, user) } sortBy Pov.priority
|
||||
}
|
||||
|
||||
def setTv(id: ID) {
|
||||
$update.fieldUnchecked(id, F.tvAt, $date(DateTime.now))
|
||||
|
|
Loading…
Reference in New Issue