From b03bf7e121db7bd97b6651fc97e6a3dd07c29691 Mon Sep 17 00:00:00 2001 From: luevard <99143550+saucepommefrite@users.noreply.github.com> Date: Wed, 22 May 2024 10:11:07 +0200 Subject: [PATCH] :sparkles: debug Popular bet --- .../src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt b/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt index 75a5f43..3751052 100644 --- a/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt +++ b/Sources/src/main/kotlin/allin/data/postgres/PostgresBetDataSource.kt @@ -112,6 +112,7 @@ class PostgresBetDataSource(private val database: Database) : BetDataSource { override fun getMostPopularBet(): Bet? { val max=database.bets.filter { (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.maxBy { it.popularityscore } + println(max) if(max!=null){ return database.bets.filter { (it.popularityscore eq max) and (it.isPrivate eq false) and (it.status eq BetStatus.WAITING) }.map { it.toBet(database) }.first() }