Skip to content

Commit ce9e1bc

Browse files
authored
Merge pull request #386 from OpenHub-Store/issue-380-ui-improvement
2 parents 49dabfb + 261d119 commit ce9e1bc

23 files changed

Lines changed: 937 additions & 62 deletions

File tree

.gradle-local/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3-bin.zip.lck

Whitespace-only changes.

.gradle-local/wrapper/dists/gradle-8.14.3-bin/cv11ve7ro1n3o1j4so8xd9n66/gradle-8.14.3-bin.zip.part

Whitespace-only changes.

core/data/schemas/zed.rainxch.core.data.local.db.AppDatabase/9.json

Lines changed: 597 additions & 0 deletions
Large diffs are not rendered by default.

core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import zed.rainxch.core.data.local.db.migrations.MIGRATION_4_5
1010
import zed.rainxch.core.data.local.db.migrations.MIGRATION_5_6
1111
import zed.rainxch.core.data.local.db.migrations.MIGRATION_6_7
1212
import zed.rainxch.core.data.local.db.migrations.MIGRATION_7_8
13+
import zed.rainxch.core.data.local.db.migrations.MIGRATION_8_9
1314

1415
fun initDatabase(context: Context): AppDatabase {
1516
val appContext = context.applicationContext
@@ -27,5 +28,6 @@ fun initDatabase(context: Context): AppDatabase {
2728
MIGRATION_5_6,
2829
MIGRATION_6_7,
2930
MIGRATION_7_8,
31+
MIGRATION_8_9,
3032
).build()
3133
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package zed.rainxch.core.data.local.db.migrations
2+
3+
import androidx.room.migration.Migration
4+
import androidx.sqlite.db.SupportSQLiteDatabase
5+
6+
val MIGRATION_8_9 =
7+
object : Migration(8, 9) {
8+
override fun migrate(db: SupportSQLiteDatabase) {
9+
db.execSQL(
10+
"ALTER TABLE installed_apps ADD COLUMN latestReleasePublishedAt TEXT",
11+
)
12+
}
13+
}

core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/AppDatabase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import zed.rainxch.core.data.local.db.entities.UpdateHistoryEntity
2727
SeenRepoEntity::class,
2828
SearchHistoryEntity::class,
2929
],
30-
version = 8,
30+
version = 9,
3131
exportSchema = true,
3232
)
3333
abstract class AppDatabase : RoomDatabase() {

core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/dao/InstalledAppDao.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ interface InstalledAppDao {
5252
releaseNotes = :releaseNotes,
5353
lastCheckedAt = :timestamp,
5454
latestVersionName = :latestVersionName,
55-
latestVersionCode = :latestVersionCode
55+
latestVersionCode = :latestVersionCode,
56+
latestReleasePublishedAt = :latestReleasePublishedAt
5657
WHERE packageName = :packageName
5758
""",
5859
)
@@ -67,6 +68,7 @@ interface InstalledAppDao {
6768
timestamp: Long,
6869
latestVersionName: String?,
6970
latestVersionCode: Long?,
71+
latestReleasePublishedAt: String?,
7072
)
7173

7274
@Query("UPDATE installed_apps SET includePreReleases = :enabled WHERE packageName = :packageName")

core/data/src/commonMain/kotlin/zed/rainxch/core/data/local/db/entities/InstalledAppEntity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ data class InstalledAppEntity(
3737
val installedVersionCode: Long = 0L,
3838
val latestVersionName: String? = null,
3939
val latestVersionCode: Long? = null,
40+
val latestReleasePublishedAt: String? = null,
4041
val includePreReleases: Boolean = false,
4142
)

core/data/src/commonMain/kotlin/zed/rainxch/core/data/mappers/InstalledAppsMappers.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fun InstalledApp.toEntity(): InstalledAppEntity =
3535
installedVersionCode = installedVersionCode,
3636
latestVersionName = latestVersionName,
3737
latestVersionCode = latestVersionCode,
38+
latestReleasePublishedAt = latestReleasePublishedAt,
3839
signingFingerprint = signingFingerprint,
3940
includePreReleases = includePreReleases,
4041
)
@@ -71,6 +72,7 @@ fun InstalledAppEntity.toDomain(): InstalledApp =
7172
installedVersionCode = installedVersionCode,
7273
latestVersionName = latestVersionName,
7374
latestVersionCode = latestVersionCode,
75+
latestReleasePublishedAt = latestReleasePublishedAt,
7476
signingFingerprint = signingFingerprint,
7577
includePreReleases = includePreReleases,
7678
)

core/data/src/commonMain/kotlin/zed/rainxch/core/data/repository/InstalledAppsRepositoryImpl.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class InstalledAppsRepositoryImpl(
149149
timestamp = System.currentTimeMillis(),
150150
latestVersionName = latestRelease.tagName,
151151
latestVersionCode = null,
152+
latestReleasePublishedAt = latestRelease.publishedAt,
152153
)
153154

154155
return isUpdateAvailable

0 commit comments

Comments
 (0)