This commit is contained in:
Horis
2024-07-26 12:18:21 +08:00
parent 675d00fcdf
commit d239583ced
2 changed files with 7 additions and 2 deletions

View File

@@ -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(

View File

@@ -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"