mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Resolved #6106 - correctly recognize mod changes of content, not just metadata
This commit is contained in:
parent
680bd1a113
commit
a5ad6c5e81
@ -184,7 +184,7 @@ class ModUIData(
|
|||||||
state.hasUpdate = isUpdated
|
state.hasUpdate = isUpdated
|
||||||
}
|
}
|
||||||
|
|
||||||
fun lastUpdated() = ruleset?.modOptions?.lastUpdated ?: repo?.updated_at ?: ""
|
fun lastUpdated() = ruleset?.modOptions?.lastUpdated ?: repo?.pushed_at ?: ""
|
||||||
fun stargazers() = repo?.stargazers_count ?: 0
|
fun stargazers() = repo?.stargazers_count ?: 0
|
||||||
fun author() = ruleset?.modOptions?.author ?: repo?.owner?.login ?: ""
|
fun author() = ruleset?.modOptions?.author ?: repo?.owner?.login ?: ""
|
||||||
fun matchesFilter(filterText: String): Boolean = when {
|
fun matchesFilter(filterText: String): Boolean = when {
|
||||||
|
@ -224,7 +224,7 @@ class ModManagementScreen(
|
|||||||
|
|
||||||
val installedMod = RulesetCache.values.firstOrNull { it.name == repo.name }
|
val installedMod = RulesetCache.values.firstOrNull { it.name == repo.name }
|
||||||
val isUpdatedVersionOfInstalledMod = installedMod?.modOptions?.let {
|
val isUpdatedVersionOfInstalledMod = installedMod?.modOptions?.let {
|
||||||
it.lastUpdated != "" && it.lastUpdated != repo.updated_at
|
it.lastUpdated != "" && it.lastUpdated != repo.pushed_at
|
||||||
} == true
|
} == true
|
||||||
|
|
||||||
if (installedMod != null) {
|
if (installedMod != null) {
|
||||||
@ -305,7 +305,7 @@ class ModManagementScreen(
|
|||||||
* @param repo: the repository instance as received from the GitHub api
|
* @param repo: the repository instance as received from the GitHub api
|
||||||
*/
|
*/
|
||||||
private fun addModInfoToActionTable(repo: Github.Repo) {
|
private fun addModInfoToActionTable(repo: Github.Repo) {
|
||||||
addModInfoToActionTable(repo.name, repo.html_url, repo.updated_at, repo.owner.login, repo.size)
|
addModInfoToActionTable(repo.name, repo.html_url, repo.pushed_at, repo.owner.login, repo.size)
|
||||||
}
|
}
|
||||||
/** Recreate the information part of the right-hand column
|
/** Recreate the information part of the right-hand column
|
||||||
* @param modName: The mod name (name from the RuleSet)
|
* @param modName: The mod name (name from the RuleSet)
|
||||||
@ -419,7 +419,7 @@ class ModManagementScreen(
|
|||||||
val modOptionsFile = modFolder.child("jsons/ModOptions.json")
|
val modOptionsFile = modFolder.child("jsons/ModOptions.json")
|
||||||
val modOptions = if (modOptionsFile.exists()) JsonParser().getFromJson(ModOptions::class.java, modOptionsFile) else ModOptions()
|
val modOptions = if (modOptionsFile.exists()) JsonParser().getFromJson(ModOptions::class.java, modOptionsFile) else ModOptions()
|
||||||
modOptions.modUrl = repo.html_url
|
modOptions.modUrl = repo.html_url
|
||||||
modOptions.lastUpdated = repo.updated_at
|
modOptions.lastUpdated = repo.pushed_at
|
||||||
modOptions.author = repo.owner.login
|
modOptions.author = repo.owner.login
|
||||||
modOptions.modSize = repo.size
|
modOptions.modSize = repo.size
|
||||||
Json().toJson(modOptions, modOptionsFile)
|
Json().toJson(modOptions, modOptionsFile)
|
||||||
|
@ -259,8 +259,7 @@ object Github {
|
|||||||
var stargazers_count = 0
|
var stargazers_count = 0
|
||||||
var default_branch = ""
|
var default_branch = ""
|
||||||
var html_url = ""
|
var html_url = ""
|
||||||
var updated_at = ""
|
var pushed_at = "" // don't use updated_at - see https://github.com/yairm210/Unciv/issues/6106
|
||||||
//var pushed_at = "" // if > updated_at might indicate an update soon?
|
|
||||||
var size = 0
|
var size = 0
|
||||||
//var stargazers_url = ""
|
//var stargazers_url = ""
|
||||||
//var homepage: String? = null // might use instead of go to repo?
|
//var homepage: String? = null // might use instead of go to repo?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user