diff --git a/app/src/main/java/com/maxrave/simpmusic/ui/MainActivity.kt b/app/src/main/java/com/maxrave/simpmusic/ui/MainActivity.kt index 71873969..738a1c82 100644 --- a/app/src/main/java/com/maxrave/simpmusic/ui/MainActivity.kt +++ b/app/src/main/java/com/maxrave/simpmusic/ui/MainActivity.kt @@ -688,6 +688,8 @@ class MainActivity : AppCompatActivity() { viewModel.checkForUpdate() viewModel.githubResponse.observe(this) { response -> if (response != null && !this.isInPictureInPictureMode && !viewModel.showedUpdateDialog) { + Log.w("MainActivity", "Check for update") + Log.w("MainActivity", "Current version: ${getString(R.string.version_format, VersionManager.getVersionName())}") if (response.tagName != getString(R.string.version_format, VersionManager.getVersionName())) { viewModel.showedUpdateDialog = true val inputFormat = diff --git a/app/src/main/java/com/maxrave/simpmusic/utils/VersionManager.kt b/app/src/main/java/com/maxrave/simpmusic/utils/VersionManager.kt index ed241871..d05eb2df 100644 --- a/app/src/main/java/com/maxrave/simpmusic/utils/VersionManager.kt +++ b/app/src/main/java/com/maxrave/simpmusic/utils/VersionManager.kt @@ -19,6 +19,14 @@ object VersionManager { fun getVersionName(): String { - return versionName ?: String() + return removeDevSuffix(versionName ?: String()) + } + + private fun removeDevSuffix(versionName: String): String { + return if (versionName.endsWith("-dev")) { + versionName.replace("-dev", "") + } else { + versionName + } } } \ No newline at end of file