From ff463aa8f405097627e2279067993739e03ad85c Mon Sep 17 00:00:00 2001 From: kahverengi Date: Sun, 2 Jun 2024 00:19:58 +0300 Subject: [PATCH] fix: fix not returning correct dependents from panel get plugins endpoint --- .../com/panomc/platform/route/api/panel/PanelGetPluginsAPI.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pano/src/main/kotlin/com/panomc/platform/route/api/panel/PanelGetPluginsAPI.kt b/Pano/src/main/kotlin/com/panomc/platform/route/api/panel/PanelGetPluginsAPI.kt index 6d7f85b2..bf694cbe 100755 --- a/Pano/src/main/kotlin/com/panomc/platform/route/api/panel/PanelGetPluginsAPI.kt +++ b/Pano/src/main/kotlin/com/panomc/platform/route/api/panel/PanelGetPluginsAPI.kt @@ -64,7 +64,7 @@ class PanelGetPluginsAPI( "version" to panoPluginDescriptor.version, "status" to plugin.pluginState, "dependencies" to panoPluginDescriptor.dependencies, - "dependents" to plugins.filter { it.descriptor.dependencies.any { it.pluginId == plugin.pluginId } } + "dependents" to plugins.filter { it.pluginState == PluginState.STARTED && it.descriptor.dependencies.any { it.pluginId == plugin.pluginId && !it.isOptional } } .map { it.pluginId }, "license" to panoPluginDescriptor.license, "error" to if (plugin.failedException == null) null else TextUtil.getStackTraceAsString(plugin.failedException),