优化
This commit is contained in:
@@ -18,7 +18,12 @@ enum class AppVariant {
|
|||||||
OFFICIAL,
|
OFFICIAL,
|
||||||
BETA_RELEASEA,
|
BETA_RELEASEA,
|
||||||
BETA_RELEASE,
|
BETA_RELEASE,
|
||||||
UNKNOWN
|
UNKNOWN;
|
||||||
|
|
||||||
|
fun isBeta(): Boolean {
|
||||||
|
return this == BETA_RELEASE || this == BETA_RELEASEA
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class GithubRelease(
|
data class GithubRelease(
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun getLatestRelease(): List<AppReleaseInfo> {
|
private suspend fun getLatestRelease(): List<AppReleaseInfo> {
|
||||||
val lastReleaseUrl = if (checkVariant.name.lowercase().contains("beta")) {
|
val lastReleaseUrl = if (checkVariant.isBeta()) {
|
||||||
"https://api.github.com/repos/gedoor/legado/releases/tags/beta"
|
"https://api.github.com/repos/gedoor/legado/releases/tags/beta"
|
||||||
} else {
|
} else {
|
||||||
"https://api.github.com/repos/gedoor/legado/releases/latest"
|
"https://api.github.com/repos/gedoor/legado/releases/latest"
|
||||||
|
|||||||
Reference in New Issue
Block a user