1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Take in account transcoding for video quota

This commit is contained in:
Chocobozzz 2017-10-19 17:33:32 +02:00
parent a10d56bafc
commit 6a84aafd23
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 56 additions and 5 deletions

View file

@ -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)
})
}