From 6a84aafd23c2f887f837cc4826cf7c8c07d1c60f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Oct 2017 17:33:32 +0200 Subject: Take in account transcoding for video quota --- server/controllers/api/config.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'server/controllers') diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index f02a2bc58..c9a051bdc 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -1,21 +1,29 @@ import * as express from 'express' import { isSignupAllowed } from '../../helpers' +import { CONFIG } from '../../initializers' import { ServerConfig } from '../../../shared' const configRouter = express.Router() configRouter.get('/', getConfig) -// Get the client credentials for the PeerTube front end function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { isSignupAllowed().then(allowed => { + const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS) + .filter(key => CONFIG.TRANSCODING.RESOLUTIONS[key] === true) + .map(r => parseInt(r, 10)) + const json: ServerConfig = { signup: { allowed + }, + transcoding: { + enabledResolutions } } + res.json(json) }) } -- cgit v1.2.3