fix updater always showing that there's an...

...update available
This commit is contained in:
jmir1 2021-05-28 14:33:49 +02:00
parent 78ba56d6d3
commit aa517952e6

View file

@ -40,15 +40,15 @@ class GithubUpdateChecker {
private fun isNewVersion(versionTag: String): Boolean {
// Removes prefixes like "r" or "v"
val newVersion = versionTag.replace("[^\\d.]".toRegex(), "")
val newVersion = versionTag.replace("[^\\d.\\-mi]".toRegex(), "")
return if (BuildConfig.DEBUG) {
// Preview builds: based on releases in "jmir1/tachiyomi-preview" repo
// tagged as something like "r1234"
newVersion.toInt() > BuildConfig.COMMIT_COUNT.toInt()
} else {
// Release builds: based on releases in "tachiyomiorg/tachiyomi" repo
// tagged as something like "v0.1.2"
// Release builds: based on releases in "jmir1/tachiyomi-mi" repo
// tagged as something like "v0.1.2-mi"
newVersion != BuildConfig.VERSION_NAME
}
}