aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-19 17:33:32 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-19 17:35:41 +0200
commit6a84aafd23c2f887f837cc4826cf7c8c07d1c60f (patch)
treecccff65aad1ff4eb53d40c604441db5d99e425b6 /server/controllers/api
parenta10d56bafc31602dfee9b1c52bbf26ab9aca366a (diff)
downloadPeerTube-6a84aafd23c2f887f837cc4826cf7c8c07d1c60f.tar.gz
PeerTube-6a84aafd23c2f887f837cc4826cf7c8c07d1c60f.tar.zst
PeerTube-6a84aafd23c2f887f837cc4826cf7c8c07d1c60f.zip
Take in account transcoding for video quota
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts10
1 files changed, 9 insertions, 1 deletions
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 @@
1import * as express from 'express' 1import * as express from 'express'
2 2
3import { isSignupAllowed } from '../../helpers' 3import { isSignupAllowed } from '../../helpers'
4import { CONFIG } from '../../initializers'
4import { ServerConfig } from '../../../shared' 5import { ServerConfig } from '../../../shared'
5 6
6const configRouter = express.Router() 7const configRouter = express.Router()
7 8
8configRouter.get('/', getConfig) 9configRouter.get('/', getConfig)
9 10
10// Get the client credentials for the PeerTube front end
11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { 11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
12 12
13 isSignupAllowed().then(allowed => { 13 isSignupAllowed().then(allowed => {
14 const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS)
15 .filter(key => CONFIG.TRANSCODING.RESOLUTIONS[key] === true)
16 .map(r => parseInt(r, 10))
17
14 const json: ServerConfig = { 18 const json: ServerConfig = {
15 signup: { 19 signup: {
16 allowed 20 allowed
21 },
22 transcoding: {
23 enabledResolutions
17 } 24 }
18 } 25 }
26
19 res.json(json) 27 res.json(json)
20 }) 28 })
21} 29}