aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-17 15:46:51 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0 (patch)
tree7a107a1abfc474e7590d3e64fac4b5b01c12c7f4 /server/models
parent662e5d4fe4b0ac61867f3f4fa3bb38a8b8e5d0f5 (diff)
downloadPeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.tar.gz
PeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.tar.zst
PeerTube-9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0.zip
Some plugins fixes and doc enhancements
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/plugin.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts
index 50963ba57..f39b97ef0 100644
--- a/server/models/server/plugin.ts
+++ b/server/models/server/plugin.ts
@@ -156,6 +156,15 @@ export class PluginModel extends Model<PluginModel> {
156 return PluginModel.findOne(query) 156 return PluginModel.findOne(query)
157 .then((c: any) => { 157 .then((c: any) => {
158 if (!c) return undefined 158 if (!c) return undefined
159 const value = c.value
160
161 if (typeof value === 'string' && value.startsWith('{')) {
162 try {
163 return JSON.parse(value)
164 } catch {
165 return value
166 }
167 }
159 168
160 return c.value 169 return c.value
161 }) 170 })