mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-21 02:29:44 +02:00
Tweak the app updater logic and add FOSS build support (#1843)
This commit is contained in:
@@ -123,7 +123,7 @@ object AboutScreen : Screen() {
|
||||
versionName = result.release.version,
|
||||
changelogInfo = result.release.info,
|
||||
releaseLink = result.release.releaseLink,
|
||||
downloadLink = result.release.getDownloadLink(),
|
||||
downloadLink = result.release.downloadLink,
|
||||
)
|
||||
navigator.push(updateScreen)
|
||||
},
|
||||
|
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.data.updater
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.util.system.isFossBuildType
|
||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
||||
import tachiyomi.core.common.util.lang.withIOContext
|
||||
import tachiyomi.domain.release.interactor.GetApplicationRelease
|
||||
@@ -20,6 +21,7 @@ class AppUpdateChecker {
|
||||
return withIOContext {
|
||||
val result = getApplicationRelease.await(
|
||||
GetApplicationRelease.Arguments(
|
||||
isFossBuildType,
|
||||
isPreviewBuildType,
|
||||
BuildConfig.COMMIT_COUNT.toInt(),
|
||||
BuildConfig.VERSION_NAME,
|
||||
|
@@ -38,7 +38,7 @@ internal class AppUpdateNotifier(private val context: Context) {
|
||||
fun promptUpdate(release: Release) {
|
||||
val updateIntent = NotificationReceiver.downloadAppUpdatePendingBroadcast(
|
||||
context,
|
||||
release.getDownloadLink(),
|
||||
release.downloadLink,
|
||||
release.version,
|
||||
)
|
||||
|
||||
|
@@ -312,7 +312,7 @@ class MainActivity : BaseActivity() {
|
||||
versionName = result.release.version,
|
||||
changelogInfo = result.release.info,
|
||||
releaseLink = result.release.releaseLink,
|
||||
downloadLink = result.release.getDownloadLink(),
|
||||
downloadLink = result.release.downloadLink,
|
||||
)
|
||||
navigator.push(updateScreen)
|
||||
}
|
||||
|
@@ -18,3 +18,6 @@ val isPreviewBuildType: Boolean
|
||||
|
||||
val isReleaseBuildType: Boolean
|
||||
inline get() = BuildConfig.BUILD_TYPE == "release"
|
||||
|
||||
val isFossBuildType: Boolean
|
||||
inline get() = BuildConfig.BUILD_TYPE == "foss"
|
||||
|
Reference in New Issue
Block a user