diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/server/plugin.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 84f7a14e4..05083e3f7 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts | |||
@@ -2,7 +2,7 @@ import { FindAndCountOptions, json, QueryTypes } from 'sequelize' | |||
2 | import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AllowNull, Column, CreatedAt, DataType, DefaultScope, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { MPlugin, MPluginFormattable } from '@server/types/models' | 3 | import { MPlugin, MPluginFormattable } from '@server/types/models' |
4 | import { AttributesOnly } from '@shared/typescript-utils' | 4 | import { AttributesOnly } from '@shared/typescript-utils' |
5 | import { PeerTubePlugin, PluginType, RegisterServerSettingOptions } from '../../../shared/models' | 5 | import { PeerTubePlugin, PluginType, RegisterServerSettingOptions, SettingEntries, SettingValue } from '../../../shared/models' |
6 | import { | 6 | import { |
7 | isPluginDescriptionValid, | 7 | isPluginDescriptionValid, |
8 | isPluginHomepage, | 8 | isPluginHomepage, |
@@ -148,7 +148,7 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> { | |||
148 | 148 | ||
149 | return PluginModel.findOne(query) | 149 | return PluginModel.findOne(query) |
150 | .then(p => { | 150 | .then(p => { |
151 | const result: { [settingName: string ]: string | boolean } = {} | 151 | const result: SettingEntries = {} |
152 | 152 | ||
153 | for (const name of settingNames) { | 153 | for (const name of settingNames) { |
154 | if (!p || !p.settings || p.settings[name] === undefined) { | 154 | if (!p || !p.settings || p.settings[name] === undefined) { |
@@ -166,7 +166,7 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> { | |||
166 | }) | 166 | }) |
167 | } | 167 | } |
168 | 168 | ||
169 | static setSetting (pluginName: string, pluginType: PluginType, settingName: string, settingValue: string) { | 169 | static setSetting (pluginName: string, pluginType: PluginType, settingName: string, settingValue: SettingValue) { |
170 | const query = { | 170 | const query = { |
171 | where: { | 171 | where: { |
172 | name: pluginName, | 172 | name: pluginName, |
@@ -273,7 +273,7 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> { | |||
273 | } | 273 | } |
274 | 274 | ||
275 | getPublicSettings (registeredSettings: RegisterServerSettingOptions[]) { | 275 | getPublicSettings (registeredSettings: RegisterServerSettingOptions[]) { |
276 | const result: { [ name: string ]: string } = {} | 276 | const result: SettingEntries = {} |
277 | const settings = this.settings || {} | 277 | const settings = this.settings || {} |
278 | 278 | ||
279 | for (const r of registeredSettings) { | 279 | for (const r of registeredSettings) { |