aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-11 17:23:24 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit8d2be0ed7bb87283a1ec98609df6b82d83db706a (patch)
tree31a36b252df32be83ceb77658a53b57f9d15e8ac /server/models
parentdba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8 (diff)
downloadPeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.gz
PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.zst
PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.zip
WIP plugins: move plugin CLI in peertube script
Install/uninstall/list plugins remotely
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/plugin.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts
index 60abaec65..226c08342 100644
--- a/server/models/server/plugin.ts
+++ b/server/models/server/plugin.ts
@@ -142,15 +142,17 @@ export class PluginModel extends Model<PluginModel> {
142 count: number, 142 count: number,
143 sort: string 143 sort: string
144 }) { 144 }) {
145 const { uninstalled = false } = options
145 const query: FindAndCountOptions = { 146 const query: FindAndCountOptions = {
146 offset: options.start, 147 offset: options.start,
147 limit: options.count, 148 limit: options.count,
148 order: getSort(options.sort), 149 order: getSort(options.sort),
149 where: {} 150 where: {
151 uninstalled
152 }
150 } 153 }
151 154
152 if (options.type) query.where['type'] = options.type 155 if (options.type) query.where['type'] = options.type
153 if (options.uninstalled) query.where['uninstalled'] = options.uninstalled
154 156
155 return PluginModel 157 return PluginModel
156 .findAndCountAll(query) 158 .findAndCountAll(query)