diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 17:33:32 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 17:35:41 +0200 |
commit | 6a84aafd23c2f887f837cc4826cf7c8c07d1c60f (patch) | |
tree | cccff65aad1ff4eb53d40c604441db5d99e425b6 /server/controllers/api | |
parent | a10d56bafc31602dfee9b1c52bbf26ab9aca366a (diff) | |
download | PeerTube-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.ts | 10 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { isSignupAllowed } from '../../helpers' | 3 | import { isSignupAllowed } from '../../helpers' |
4 | import { CONFIG } from '../../initializers' | ||
4 | import { ServerConfig } from '../../../shared' | 5 | import { ServerConfig } from '../../../shared' |
5 | 6 | ||
6 | const configRouter = express.Router() | 7 | const configRouter = express.Router() |
7 | 8 | ||
8 | configRouter.get('/', getConfig) | 9 | configRouter.get('/', getConfig) |
9 | 10 | ||
10 | // Get the client credentials for the PeerTube front end | ||
11 | function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 11 | function 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 | } |