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:
parent
a10d56bafc
commit
6a84aafd23
8 changed files with 56 additions and 5 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue