feat: show even uninstalled active plugins if set via config

isekai-main
oplik0 2 years ago committed by Julian Lam
parent 74cb224344
commit 2bfdd76180

@ -15,8 +15,8 @@ pluginsController.get = async function (req, res) {
]); ]);
const compatiblePkgNames = compatible.map(pkgData => pkgData.name); const compatiblePkgNames = compatible.map(pkgData => pkgData.name);
const installedPlugins = compatible.filter(plugin => plugin && plugin.installed); const installedPlugins = compatible.filter(plugin => plugin && (plugin.installed || (nconf.get('plugins:active') && plugin.active)));
const activePlugins = all.filter(plugin => plugin && plugin.installed && plugin.active); const activePlugins = all.filter(plugin => plugin && (plugin.installed || nconf.get('plugins:active')) && plugin.active);
const trendingScores = trending.reduce((memo, cur) => { const trendingScores = trending.reduce((memo, cur) => {
memo[cur.label] = cur.value; memo[cur.label] = cur.value;

@ -234,6 +234,13 @@ Plugins.normalise = async function (apiReturn) {
pluginMap[plugin.id].outdated = semver.gt(pluginMap[plugin.id].latest, pluginMap[plugin.id].version); pluginMap[plugin.id].outdated = semver.gt(pluginMap[plugin.id].latest, pluginMap[plugin.id].version);
}); });
if (nconf.get('plugins:active')) {
nconf.get('plugins:active').forEach((id) => {
pluginMap[id] = pluginMap[id] || {};
pluginMap[id].active = true;
});
}
const pluginArray = Object.values(pluginMap); const pluginArray = Object.values(pluginMap);
pluginArray.sort((a, b) => { pluginArray.sort((a, b) => {

Loading…
Cancel
Save