diff options
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index f678e3c4a..3788975a9 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -80,6 +80,14 @@ async function getConfig (req: express.Request, res: express.Response, next: exp | |||
80 | extensions: CONSTRAINTS_FIELDS.VIDEOS.EXTNAME | 80 | extensions: CONSTRAINTS_FIELDS.VIDEOS.EXTNAME |
81 | } | 81 | } |
82 | }, | 82 | }, |
83 | videoCaption: { | ||
84 | file: { | ||
85 | size: { | ||
86 | max: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max | ||
87 | }, | ||
88 | extensions: CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.EXTNAME | ||
89 | } | ||
90 | }, | ||
83 | user: { | 91 | user: { |
84 | videoQuota: CONFIG.USER.VIDEO_QUOTA | 92 | videoQuota: CONFIG.USER.VIDEO_QUOTA |
85 | } | 93 | } |
@@ -122,12 +130,13 @@ async function updateCustomConfig (req: express.Request, res: express.Response, | |||
122 | 130 | ||
123 | // Force number conversion | 131 | // Force number conversion |
124 | toUpdate.cache.previews.size = parseInt('' + toUpdate.cache.previews.size, 10) | 132 | toUpdate.cache.previews.size = parseInt('' + toUpdate.cache.previews.size, 10) |
133 | toUpdate.cache.captions.size = parseInt('' + toUpdate.cache.captions.size, 10) | ||
125 | toUpdate.signup.limit = parseInt('' + toUpdate.signup.limit, 10) | 134 | toUpdate.signup.limit = parseInt('' + toUpdate.signup.limit, 10) |
126 | toUpdate.user.videoQuota = parseInt('' + toUpdate.user.videoQuota, 10) | 135 | toUpdate.user.videoQuota = parseInt('' + toUpdate.user.videoQuota, 10) |
127 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) | 136 | toUpdate.transcoding.threads = parseInt('' + toUpdate.transcoding.threads, 10) |
128 | 137 | ||
129 | // camelCase to snake_case key | 138 | // camelCase to snake_case key |
130 | const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription') | 139 | const toUpdateJSON = omit(toUpdate, 'user.videoQuota', 'instance.defaultClientRoute', 'instance.shortDescription', 'cache.videoCaptions') |
131 | toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota | 140 | toUpdateJSON.user['video_quota'] = toUpdate.user.videoQuota |
132 | toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute | 141 | toUpdateJSON.instance['default_client_route'] = toUpdate.instance.defaultClientRoute |
133 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription | 142 | toUpdateJSON.instance['short_description'] = toUpdate.instance.shortDescription |
@@ -172,6 +181,9 @@ function customConfig (): CustomConfig { | |||
172 | cache: { | 181 | cache: { |
173 | previews: { | 182 | previews: { |
174 | size: CONFIG.CACHE.PREVIEWS.SIZE | 183 | size: CONFIG.CACHE.PREVIEWS.SIZE |
184 | }, | ||
185 | captions: { | ||
186 | size: CONFIG.CACHE.VIDEO_CAPTIONS.SIZE | ||
175 | } | 187 | } |
176 | }, | 188 | }, |
177 | signup: { | 189 | signup: { |