Additional checks for listed and approve in fetching release date (KT-30388)
This commit is contained in:
@@ -336,6 +336,11 @@ class KotlinPluginUpdater(private val propertiesComponent: PropertiesComponent)
|
|||||||
private class PluginDTO {
|
private class PluginDTO {
|
||||||
var cdate: String? = null
|
var cdate: String? = null
|
||||||
var channel: String? = null
|
var channel: String? = null
|
||||||
|
// `true` if the version is seen in plugin site and available for download.
|
||||||
|
// Maybe be `false` if author requested version deletion.
|
||||||
|
var listed: Boolean = true
|
||||||
|
// `true` if version is approved and verified
|
||||||
|
var approve: Boolean = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(IOException::class, ResponseParseException::class)
|
@Throws(IOException::class, ResponseParseException::class)
|
||||||
@@ -352,7 +357,10 @@ class KotlinPluginUpdater(private val propertiesComponent: PropertiesComponent)
|
|||||||
throw ResponseParseException("Can't parse json response", syntaxException)
|
throw ResponseParseException("Can't parse json response", syntaxException)
|
||||||
}
|
}
|
||||||
|
|
||||||
val selectedPluginDTO = pluginDTOs.singleOrNull { it.channel == channel || (it.channel == "" && channel == null) }
|
val selectedPluginDTO = pluginDTOs
|
||||||
|
.firstOrNull {
|
||||||
|
it.listed && it.approve && (it.channel == channel || (it.channel == "" && channel == null))
|
||||||
|
}
|
||||||
?: return null
|
?: return null
|
||||||
|
|
||||||
val dateString = selectedPluginDTO.cdate ?: throw ResponseParseException("Empty cdate")
|
val dateString = selectedPluginDTO.cdate ?: throw ResponseParseException("Empty cdate")
|
||||||
|
|||||||
Reference in New Issue
Block a user