aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-05 15:28:49 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commitf023a19c3eeeea2b014b47fae522a62eab320048 (patch)
tree988ff97432663db928f1e3e3f498da856e739de1 /server/models
parent345da516fae80f24c90c2196e96393b489af2243 (diff)
downloadPeerTube-f023a19c3eeeea2b014b47fae522a62eab320048.tar.gz
PeerTube-f023a19c3eeeea2b014b47fae522a62eab320048.tar.zst
PeerTube-f023a19c3eeeea2b014b47fae522a62eab320048.zip
WIP plugins: install/uninstall
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/plugin.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts
index 7ce376d13..1fbfd208f 100644
--- a/server/models/server/plugin.ts
+++ b/server/models/server/plugin.ts
@@ -42,7 +42,6 @@ export class PluginModel extends Model<PluginModel> {
42 uninstalled: boolean 42 uninstalled: boolean
43 43
44 @AllowNull(false) 44 @AllowNull(false)
45 @Is('PluginPeertubeEngine', value => throwIfNotValid(value, isPluginVersionValid, 'peertubeEngine'))
46 @Column 45 @Column
47 peertubeEngine: string 46 peertubeEngine: string
48 47
@@ -76,4 +75,14 @@ export class PluginModel extends Model<PluginModel> {
76 return PluginModel.findAll(query) 75 return PluginModel.findAll(query)
77 } 76 }
78 77
78 static uninstall (pluginName: string) {
79 const query = {
80 where: {
81 name: pluginName
82 }
83 }
84
85 return PluginModel.update({ enabled: false, uninstalled: true }, query)
86 }
87
79} 88}