Skip to content

Commit

Permalink
fix updater always showing that there's an...
Browse files Browse the repository at this point in the history
...update available
  • Loading branch information
jmir1 committed May 28, 2021
1 parent 78ba56d commit aa51795
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit aa51795

Please sign in to comment.