fix: plugin version not updated after upgrade (#3166)
This commit is contained in:
parent
810ab3294d
commit
d782776a8d
@ -106,6 +106,8 @@ export class PresetNocoBase extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getPluginToBeUpgraded() {
|
async getPluginToBeUpgraded() {
|
||||||
|
const repository = this.app.db.getRepository<any>('applicationPlugins');
|
||||||
|
const items = (await repository.find()).map((item) => item.name);
|
||||||
const plugins = this.getBuiltInPlugins().map((name) => {
|
const plugins = this.getBuiltInPlugins().map((name) => {
|
||||||
const packageName = PluginManager.getPackageName(name);
|
const packageName = PluginManager.getPackageName(name);
|
||||||
const packageJson = PluginManager.getPackageJson(packageName);
|
const packageJson = PluginManager.getPackageJson(packageName);
|
||||||
@ -113,7 +115,8 @@ export class PresetNocoBase extends Plugin {
|
|||||||
});
|
});
|
||||||
for (const plugin of this.getLocalPlugins()) {
|
for (const plugin of this.getLocalPlugins()) {
|
||||||
if (plugin[1]) {
|
if (plugin[1]) {
|
||||||
if (await this.app.version.satisfies(`>${plugin[1]}`)) {
|
// 不在插件列表,并且插件最低版本小于当前应用版本,跳过不处理
|
||||||
|
if (!items.includes(plugin[0]) && (await this.app.version.satisfies(`>${plugin[1]}`))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user