|
|
|
|
@ -9,6 +9,7 @@ import kotlinx.coroutines.CoroutineScope |
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import net.pokeranalytics.android.calculus.optimalduration.CashGameOptimalDurationCalculator |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.LiveOnline |
|
|
|
|
import net.pokeranalytics.android.model.realm.* |
|
|
|
|
import net.pokeranalytics.android.ui.view.rows.StaticReport |
|
|
|
|
@ -201,7 +202,7 @@ class ReportTask(private var whistleBlower: ReportWhistleBlower, var context: Co |
|
|
|
|
|
|
|
|
|
val nameSeparator = " " |
|
|
|
|
|
|
|
|
|
for (stat in result.options.stats) { |
|
|
|
|
for (stat in staticReport.performanceStats) { |
|
|
|
|
|
|
|
|
|
// Timber.d("analyse stat: $stat for report: $staticReport") |
|
|
|
|
|
|
|
|
|
@ -222,7 +223,8 @@ class ReportTask(private var whistleBlower: ReportWhistleBlower, var context: Co |
|
|
|
|
val performanceQuery = computedResults.group.query |
|
|
|
|
val performanceName = performanceQuery.getName(this.context, nameSeparator) |
|
|
|
|
|
|
|
|
|
// Timber.d("Best computed = $performanceName, ${computedResults.computedStat(Stat.NET_RESULT)?.value}") |
|
|
|
|
val count = computedResults.computedStat(Stat.NUMBER_OF_GAMES)?.value?.toInt() ?: throw PAIllegalStateException("Number of games not found") |
|
|
|
|
val notify = !(stat.hasEarlyVariance && count < 10) |
|
|
|
|
|
|
|
|
|
var storePerf = true |
|
|
|
|
currentPerf?.let { |
|
|
|
|
@ -243,7 +245,10 @@ class ReportTask(private var whistleBlower: ReportWhistleBlower, var context: Co |
|
|
|
|
currentPerf.objectId = performanceQuery.objectId |
|
|
|
|
currentPerf.customFieldId = customField?.id |
|
|
|
|
} |
|
|
|
|
this.whistleBlower.notify(currentPerf) |
|
|
|
|
|
|
|
|
|
if (notify) { |
|
|
|
|
this.whistleBlower.notify(currentPerf) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -258,7 +263,9 @@ class ReportTask(private var whistleBlower: ReportWhistleBlower, var context: Co |
|
|
|
|
null |
|
|
|
|
) |
|
|
|
|
realm.executeTransaction { it.copyToRealm(performance) } |
|
|
|
|
this.whistleBlower.notify(performance) |
|
|
|
|
if (notify) { |
|
|
|
|
this.whistleBlower.notify(performance) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} ?: run { // if there is no max but a now irrelevant Performance, we delete it |
|
|
|
|
|