mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add updatedFrom param in marketplace plugin download requests
Fix npe Add updatedFrom param in marketplace plugin download requests Merge-request: IJ-MR-122517 Merged-by: Sergey Kesarev <sergey.kesarev@jetbrains.com> GitOrigin-RevId: d858958b5afb63e04ba978269652dba9383cb638
This commit is contained in:
committed by
intellij-monorepo-bot
parent
87424cacb2
commit
c14b9cdd8b
@@ -842,7 +842,7 @@ object PluginManagerCore {
|
||||
@Internal
|
||||
@JvmStatic
|
||||
fun findPlugin(id: PluginId): IdeaPluginDescriptorImpl? {
|
||||
val pluginSet = getPluginSet()
|
||||
val pluginSet = nullablePluginSet ?: return null
|
||||
return pluginSet.findEnabledPlugin(id) ?: pluginSet.findInstalledPlugin(id)
|
||||
}
|
||||
|
||||
|
||||
+9
-2
@@ -85,11 +85,18 @@ internal object MarketplaceUrls {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getPluginDownloadUrl(descriptor: IdeaPluginDescriptor, uuid: String, buildNumber: BuildNumber?): String {
|
||||
fun getPluginDownloadUrl(
|
||||
descriptor: IdeaPluginDescriptor,
|
||||
uuid: String,
|
||||
buildNumber: BuildNumber?,
|
||||
currentVersion: IdeaPluginDescriptor?
|
||||
): String {
|
||||
val updatedFrom = currentVersion?.version ?: ""
|
||||
val parameters = hashMapOf(
|
||||
"id" to descriptor.pluginId.idString,
|
||||
"build" to ApplicationInfoImpl.orFromPluginCompatibleBuild(buildNumber),
|
||||
"uuid" to uuid
|
||||
"uuid" to uuid,
|
||||
"updatedFrom" to updatedFrom
|
||||
)
|
||||
(descriptor as? PluginNode)?.channel?.let {
|
||||
parameters["channel"] = it
|
||||
|
||||
+2
-1
@@ -379,9 +379,10 @@ public final class PluginDownloader {
|
||||
public static @NotNull PluginDownloader createDownloader(@NotNull IdeaPluginDescriptor descriptor,
|
||||
@Nullable String host,
|
||||
@Nullable BuildNumber buildNumber) throws IOException {
|
||||
IdeaPluginDescriptor currentVersion = PluginManagerCore.getPlugin(descriptor.getPluginId());
|
||||
String url = descriptor instanceof PluginNode && host != null ?
|
||||
toAbsoluteUrl(((PluginNode)descriptor).getDownloadUrl(), host) :
|
||||
MarketplaceUrls.getPluginDownloadUrl(descriptor, getMarketplaceDownloadsUUID(), buildNumber);
|
||||
MarketplaceUrls.getPluginDownloadUrl(descriptor, getMarketplaceDownloadsUUID(), buildNumber, currentVersion);
|
||||
|
||||
return new PluginDownloader(descriptor,
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user