1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add ability for admins to set default p2p policy

This commit is contained in:
Chocobozzz 2021-12-15 15:58:10 +01:00
parent c77fdc605b
commit a9bfa85d2c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
59 changed files with 789 additions and 415 deletions

View file

@ -197,7 +197,7 @@ async function updateMe (req: express.Request, res: express.Response) {
const keysToUpdate: (keyof UserUpdateMe & keyof AttributesOnly<UserModel>)[] = [
'password',
'nsfwPolicy',
'webTorrentEnabled',
'p2pEnabled',
'autoPlayVideo',
'autoPlayNextVideo',
'autoPlayNextVideoPlaylist',
@ -213,6 +213,12 @@ async function updateMe (req: express.Request, res: express.Response) {
if (body[key] !== undefined) user.set(key, body[key])
}
if (body.p2pEnabled !== undefined) {
user.set('p2pEnabled', body.p2pEnabled)
} else if (body.webTorrentEnabled !== undefined) { // FIXME: deprecated in 4.1
user.set('p2pEnabled', body.webTorrentEnabled)
}
if (body.email !== undefined) {
if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
user.pendingEmail = body.email