|
|
|
|
@ -11,6 +11,7 @@ import io.realm.RealmConfiguration |
|
|
|
|
import io.realm.kotlin.where |
|
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import net.pokeranalytics.android.calculus.optimalduration.CashGameOptimalDurationCalculator |
|
|
|
|
import net.pokeranalytics.android.model.migrations.Patcher |
|
|
|
|
import net.pokeranalytics.android.model.migrations.PokerAnalyticsMigration |
|
|
|
|
import net.pokeranalytics.android.model.realm.Session |
|
|
|
|
@ -75,7 +76,14 @@ class PokerAnalyticsApplication : Application() { |
|
|
|
|
|
|
|
|
|
if (BuildConfig.DEBUG) { |
|
|
|
|
Timber.d("UserPreferences.defaultCurrency: ${UserDefaults.currency.symbol}") |
|
|
|
|
// this.createFakeSessions() |
|
|
|
|
this.createFakeSessions() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CashGameOptimalDurationCalculator.start(true) { |
|
|
|
|
|
|
|
|
|
val hours = it / 3600 / 1000 |
|
|
|
|
|
|
|
|
|
Timber.d("Optimal duration = ${it}, $hours") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Patcher.patchAll(this.applicationContext) |
|
|
|
|
@ -91,9 +99,9 @@ class PokerAnalyticsApplication : Application() { |
|
|
|
|
val sessionsCount = realm.where<Session>().count() |
|
|
|
|
realm.close() |
|
|
|
|
|
|
|
|
|
if (sessionsCount < 10) { |
|
|
|
|
if (sessionsCount < 1000) { |
|
|
|
|
GlobalScope.launch { |
|
|
|
|
FakeDataManager.createFakeSessions(200) |
|
|
|
|
FakeDataManager.createFakeSessions(500) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|