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