diff --git a/web_interface/static/v3/plugins_manager.js b/web_interface/static/v3/plugins_manager.js index 01bc1df9..b6111066 100644 --- a/web_interface/static/v3/plugins_manager.js +++ b/web_interface/static/v3/plugins_manager.js @@ -5251,8 +5251,17 @@ function showStoreLoading(show) { // ── Plugin Store: Client-Side Filter/Sort/Pagination ──────────────────────── -function isStorePluginInstalled(pluginId) { - return (window.installedPlugins || installedPlugins || []).some(p => p.id === pluginId); +function isStorePluginInstalled(pluginIdOrPlugin) { + const installed = window.installedPlugins || installedPlugins || []; + // Accept either a plain ID string or a store plugin object (which may have plugin_path) + if (typeof pluginIdOrPlugin === 'string') { + return installed.some(p => p.id === pluginIdOrPlugin); + } + const storeId = pluginIdOrPlugin.id; + // Derive the actual installed directory name from plugin_path (e.g. "plugins/ledmatrix-weather" → "ledmatrix-weather") + const pluginPath = pluginIdOrPlugin.plugin_path || ''; + const pathDerivedId = pluginPath ? pluginPath.split('/').pop() : null; + return installed.some(p => p.id === storeId || (pathDerivedId && p.id === pathDerivedId)); } function applyStoreFiltersAndSort(skipPageReset) { @@ -5282,9 +5291,9 @@ function applyStoreFiltersAndSort(skipPageReset) { // Installed filter if (st.filterInstalled === true) { - list = list.filter(plugin => isStorePluginInstalled(plugin.id)); + list = list.filter(plugin => isStorePluginInstalled(plugin)); } else if (st.filterInstalled === false) { - list = list.filter(plugin => !isStorePluginInstalled(plugin.id)); + list = list.filter(plugin => !isStorePluginInstalled(plugin)); } // Sort @@ -5531,7 +5540,7 @@ function renderPluginStore(plugins) { }; container.innerHTML = plugins.map(plugin => { - const installed = isStorePluginInstalled(plugin.id); + const installed = isStorePluginInstalled(plugin); return `