aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-12 10:10:48 +0200
committerChocobozzz <me@florianbigard.com>2021-04-12 10:10:48 +0200
commit8280d0c22797c72978f698dc2deaa8ef569a9d15 (patch)
tree8136abd28c9aa0c5050bb66e2f6f7451117b57f2 /server/lib/plugins/plugin-index.ts
parent90aa0a74e95d390d62942aa72d481d5aa7b5ac23 (diff)
downloadPeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.tar.gz
PeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.tar.zst
PeerTube-8280d0c22797c72978f698dc2deaa8ef569a9d15.zip
Ensure to install supported plugins
Diffstat (limited to 'server/lib/plugins/plugin-index.ts')
-rw-r--r--server/lib/plugins/plugin-index.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/lib/plugins/plugin-index.ts b/server/lib/plugins/plugin-index.ts
index 624f5da1d..165bc91b3 100644
--- a/server/lib/plugins/plugin-index.ts
+++ b/server/lib/plugins/plugin-index.ts
@@ -67,7 +67,19 @@ async function getLatestPluginsVersion (npmNames: string[]): Promise<PeertubePlu
67 return body 67 return body
68} 68}
69 69
70async function getLatestPluginVersion (npmName: string) {
71 const results = await getLatestPluginsVersion([ npmName ])
72
73 if (Array.isArray(results) === false || results.length !== 1) {
74 logger.warn('Cannot get latest supported plugin version of %s.', npmName)
75 return undefined
76 }
77
78 return results[0].latestVersion
79}
80
70export { 81export {
71 listAvailablePluginsFromIndex, 82 listAvailablePluginsFromIndex,
83 getLatestPluginVersion,
72 getLatestPluginsVersion 84 getLatestPluginsVersion
73} 85}