mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -18,7 +18,12 @@ enum class AppVariant {
|
||||
OFFICIAL,
|
||||
BETA_RELEASEA,
|
||||
BETA_RELEASE,
|
||||
UNKNOWN
|
||||
UNKNOWN;
|
||||
|
||||
fun isBeta(): Boolean {
|
||||
return this == BETA_RELEASE || this == BETA_RELEASEA
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class GithubRelease(
|
||||
|
||||
@@ -24,7 +24,7 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
|
||||
}
|
||||
|
||||
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"
|
||||
} else {
|
||||
"https://api.github.com/repos/gedoor/legado/releases/latest"
|
||||
|
||||
Reference in New Issue
Block a user