aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorlutangar <johan.dufour@gmail.com>2021-12-15 09:35:17 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-12-16 10:17:39 +0100
commitced38c0ffe1e7d30f1f80fe704e571f39b0cc78b (patch)
treec6f435714e729c115154fc642ce0129917df198a /server/models
parent85302118227bad232afdebb84a5c245f862366bd (diff)
downloadPeerTube-ced38c0ffe1e7d30f1f80fe704e571f39b0cc78b.tar.gz
PeerTube-ced38c0ffe1e7d30f1f80fe704e571f39b0cc78b.tar.zst
PeerTube-ced38c0ffe1e7d30f1f80fe704e571f39b0cc78b.zip
fix plugin storage return value when storing a Json array
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/plugin.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts
index a8de64dd4..c79178782 100644
--- a/server/models/server/plugin.ts
+++ b/server/models/server/plugin.ts
@@ -197,15 +197,11 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> {
197 if (!c) return undefined 197 if (!c) return undefined
198 const value = c.value 198 const value = c.value
199 199
200 if (typeof value === 'string' && value.startsWith('{')) { 200 try {
201 try { 201 return JSON.parse(value)
202 return JSON.parse(value) 202 } catch {
203 } catch { 203 return value
204 return value
205 }
206 } 204 }
207
208 return c.value
209 }) 205 })
210 } 206 }
211 207