Skip to content

Commit 452dc93

Browse files
authored
Merge pull request #337 from joreilly/dependency_updates
dependency updates
2 parents fc70d4f + cccc082 commit 452dc93

File tree

13 files changed

+48
-43
lines changed

13 files changed

+48
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Fantasy Premier League
22

3-
![kotlin-version](https://img.shields.io/badge/kotlin-2.2.0-blue?logo=kotlin)
3+
![kotlin-version](https://img.shields.io/badge/kotlin-2.2.10-blue?logo=kotlin)
44

55
**Kotlin Multiplatform** project with Jetpack Compose, Compose for Desktop and SwiftUI clients (and using Ktor for remote API requests and Room for persistence). Currently running on:
66
* Android (Jetpack Compose)

app/src/main/java/dev/johnoreilly/fantasypremierleague/presentation/fixtures/FixtureDetails/FixtureDetailsView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fun FixtureDetailsView(fixtureId: Int, popBackStack: () -> Unit) {
8989
)
9090
}
9191

92-
fixture.localKickoffTime.let { localKickoffTime ->
92+
fixture.localKickoffTime?.let { localKickoffTime ->
9393
val formattedTime = "%02d:%02d".format(localKickoffTime.hour, localKickoffTime.minute)
9494
PastFixtureStatView(statName = "Date", statValue = localKickoffTime.date.toString())
9595
PastFixtureStatView(statName = "Kick Off Time", statValue = formattedTime)

app/src/main/java/dev/johnoreilly/fantasypremierleague/presentation/fixtures/FixtureView.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ fun FixtureView(
7676
fixture.awayTeamPhotoUrl
7777
)
7878
}
79-
Text(
80-
modifier = Modifier.padding(top = 16.dp),
81-
text = fixture.localKickoffTime.date.toString(),
82-
fontWeight = FontWeight.Light,
83-
fontSize = 14.sp
84-
)
8579

86-
fixture.localKickoffTime.let { localKickoffTime ->
80+
fixture.localKickoffTime?.let { localKickoffTime ->
81+
Text(
82+
modifier = Modifier.padding(top = 16.dp),
83+
text = localKickoffTime.date.toString(),
84+
fontWeight = FontWeight.Light,
85+
fontSize = 14.sp
86+
)
87+
8788
val formattedTime = "%02d:%02d".format(localKickoffTime.hour, localKickoffTime.minute)
8889
Text(
8990
modifier = Modifier.padding(bottom = 16.dp),

common/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ kotlin {
4343
androidTarget()
4444
jvm()
4545

46-
47-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
48-
compilerOptions {
49-
languageVersion.set(KotlinVersion.KOTLIN_2_0)
50-
}
51-
5246
sourceSets {
5347
all {
5448
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")

common/schemas/dev.johnoreilly.common.database.AppDatabase/1.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"formatVersion": 1,
33
"database": {
44
"version": 1,
5-
"identityHash": "1d6755f9cf99963261ab91735a13f1a9",
5+
"identityHash": "99d7047cc9aebd2bf9feb7a16411f0f0",
66
"entities": [
77
{
88
"tableName": "Team",
@@ -102,7 +102,7 @@
102102
},
103103
{
104104
"tableName": "GameFixture",
105-
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `localKickoffTime` TEXT NOT NULL, `homeTeam` TEXT NOT NULL, `awayTeam` TEXT NOT NULL, `homeTeamPhotoUrl` TEXT NOT NULL, `awayTeamPhotoUrl` TEXT NOT NULL, `homeTeamScore` INTEGER, `awayTeamScore` INTEGER, `event` INTEGER NOT NULL, PRIMARY KEY(`id`))",
105+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `localKickoffTime` TEXT, `homeTeam` TEXT NOT NULL, `awayTeam` TEXT NOT NULL, `homeTeamPhotoUrl` TEXT NOT NULL, `awayTeamPhotoUrl` TEXT NOT NULL, `homeTeamScore` INTEGER, `awayTeamScore` INTEGER, `event` INTEGER NOT NULL, PRIMARY KEY(`id`))",
106106
"fields": [
107107
{
108108
"fieldPath": "id",
@@ -113,8 +113,7 @@
113113
{
114114
"fieldPath": "localKickoffTime",
115115
"columnName": "localKickoffTime",
116-
"affinity": "TEXT",
117-
"notNull": true
116+
"affinity": "TEXT"
118117
},
119118
{
120119
"fieldPath": "homeTeam",
@@ -167,7 +166,7 @@
167166
],
168167
"setupQueries": [
169168
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
170-
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1d6755f9cf99963261ab91735a13f1a9')"
169+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '99d7047cc9aebd2bf9feb7a16411f0f0')"
171170
]
172171
}
173172
}

common/src/commonMain/kotlin/dev/johnoreilly/common/data/model/FixtureDto.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
@file:OptIn(ExperimentalTime::class)
2+
13
package dev.johnoreilly.common.data.model
24

3-
import kotlinx.datetime.Instant
45
import kotlinx.serialization.Serializable
6+
import kotlin.time.ExperimentalTime
7+
import kotlin.time.Instant
58

69
@Serializable
710
data class FixtureDto(

common/src/commonMain/kotlin/dev/johnoreilly/common/data/repository/FantasyPremierLeagueRepository.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import kotlinx.datetime.toInstant
2222
import kotlinx.datetime.toLocalDateTime
2323
import org.koin.core.component.KoinComponent
2424
import org.koin.core.component.inject
25+
import kotlin.time.ExperimentalTime
2526

2627

2728
class FantasyPremierLeagueRepository : KoinComponent {
@@ -54,6 +55,7 @@ class FantasyPremierLeagueRepository : KoinComponent {
5455
}
5556

5657

58+
@OptIn(ExperimentalTime::class)
5759
private suspend fun writeDataToDb(
5860
bootstrapStaticInfoDto: BootstrapStaticInfoDto,
5961
fixtures: List<FixtureDto>
@@ -99,8 +101,9 @@ class FantasyPremierLeagueRepository : KoinComponent {
99101
val homeTeamPhotoUrl = "https://resources.premierleague.com/premierleague/badges/t${homeTeam?.code}.png"
100102
val awayTeamPhotoUrl = "https://resources.premierleague.com/premierleague/badges/t${awayTeam?.code}.png"
101103

102-
val localKickoffTime = fixtureDto.kickoff_time.toString().toInstant()
103-
.toLocalDateTime(TimeZone.currentSystemDefault())
104+
105+
//.toString().toInstant(TimeZone.currentSystemDefault())
106+
val localKickoffTime = fixtureDto.kickoff_time?.toLocalDateTime(TimeZone.currentSystemDefault())
104107

105108
GameFixture(
106109
fixtureDto.id,

common/src/commonMain/kotlin/dev/johnoreilly/common/model/GameFixture.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.datetime.LocalDateTime
66
@Entity
77
data class GameFixture(
88
@PrimaryKey val id: Int,
9-
val localKickoffTime: LocalDateTime,
9+
val localKickoffTime: LocalDateTime?,
1010
val homeTeam: String,
1111
val awayTeam: String,
1212
val homeTeamPhotoUrl: String,

common/src/jvmMain/kotlin/dev/johnoreilly/common/Main.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import dev.johnoreilly.common.di.initKoin
66
import kotlinx.datetime.*
77
import org.ojalgo.okalgo.*
88
import org.ojalgo.optimisation.Variable
9+
import kotlin.time.ExperimentalTime
910

11+
@OptIn(ExperimentalTime::class)
1012
suspend fun main() {
1113
val koin = initKoin(enableNetworkLogs = true).koin
1214

common/src/jvmMain/kotlin/dev/johnoreilly/common/actual.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ actual fun platformModule() = module {
1818

1919

2020
fun createRoomDatabase(): AppDatabase {
21-
val dbFile = File(System.getProperty("java.io.tmpdir"), dbFileName)
21+
val dbFile = File(dbFileName)
2222
return Room.databaseBuilder<AppDatabase>(name = dbFile.absolutePath,)
2323
.setDriver(BundledSQLiteDriver())
2424
.build()

0 commit comments

Comments
 (0)