mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -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
|
||||
}
|
||||
|
||||
fun lastUpdated() = ruleset?.modOptions?.lastUpdated ?: repo?.updated_at ?: ""
|
||||
fun lastUpdated() = ruleset?.modOptions?.lastUpdated ?: repo?.pushed_at ?: ""
|
||||
fun stargazers() = repo?.stargazers_count ?: 0
|
||||
fun author() = ruleset?.modOptions?.author ?: repo?.owner?.login ?: ""
|
||||
fun matchesFilter(filterText: String): Boolean = when {
|
||||
|
@ -224,7 +224,7 @@ class ModManagementScreen(
|
||||
|
||||
val installedMod = RulesetCache.values.firstOrNull { it.name == repo.name }
|
||||
val isUpdatedVersionOfInstalledMod = installedMod?.modOptions?.let {
|
||||
it.lastUpdated != "" && it.lastUpdated != repo.updated_at
|
||||
it.lastUpdated != "" && it.lastUpdated != repo.pushed_at
|
||||
} == true
|
||||
|
||||
if (installedMod != null) {
|
||||
@ -305,7 +305,7 @@ class ModManagementScreen(
|
||||
* @param repo: the repository instance as received from the GitHub api
|
||||
*/
|
||||
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
|
||||
* @param modName: The mod name (name from the RuleSet)
|
||||
@ -419,7 +419,7 @@ class ModManagementScreen(
|
||||
val modOptionsFile = modFolder.child("jsons/ModOptions.json")
|
||||
val modOptions = if (modOptionsFile.exists()) JsonParser().getFromJson(ModOptions::class.java, modOptionsFile) else ModOptions()
|
||||
modOptions.modUrl = repo.html_url
|
||||
modOptions.lastUpdated = repo.updated_at
|
||||
modOptions.lastUpdated = repo.pushed_at
|
||||
modOptions.author = repo.owner.login
|
||||
modOptions.modSize = repo.size
|
||||
Json().toJson(modOptions, modOptionsFile)
|
||||
|
@ -259,8 +259,7 @@ object Github {
|
||||
var stargazers_count = 0
|
||||
var default_branch = ""
|
||||
var html_url = ""
|
||||
var updated_at = ""
|
||||
//var pushed_at = "" // if > updated_at might indicate an update soon?
|
||||
var pushed_at = "" // don't use updated_at - see https://github.com/yairm210/Unciv/issues/6106
|
||||
var size = 0
|
||||
//var stargazers_url = ""
|
||||
//var homepage: String? = null // might use instead of go to repo?
|
||||
|
Loading…
x
Reference in New Issue
Block a user