mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Ensure to install supported plugins
This commit is contained in:
parent
90aa0a74e9
commit
8280d0c227
5 changed files with 30 additions and 10 deletions
|
@ -328,11 +328,18 @@ export class PluginManager implements ServerHook {
|
|||
return plugin
|
||||
}
|
||||
|
||||
async update (toUpdate: string, version?: string, fromDisk = false) {
|
||||
async update (toUpdate: string, fromDisk = false) {
|
||||
const npmName = fromDisk ? basename(toUpdate) : toUpdate
|
||||
|
||||
logger.info('Updating plugin %s.', npmName)
|
||||
|
||||
// Use the latest version from DB, to not upgrade to a version that does not support our PeerTube version
|
||||
let version: string
|
||||
if (!fromDisk) {
|
||||
const plugin = await PluginModel.loadByNpmName(toUpdate)
|
||||
version = plugin.latestVersion
|
||||
}
|
||||
|
||||
// Unregister old hooks
|
||||
await this.unregister(npmName)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue