X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fserver%2Fconfig-command.ts;h=b94bd2625a9cefea6b01def9c5a20c32f90d03e6;hb=6292fb984348935692711ddc9a9630e29c3f0148;hp=51267b85b31088a63ecac17e1020b0a7cdad2e49;hpb=4e4c23c5b8d55ab0aa48a7be8c53ec71d1d7e796;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 51267b85b..b94bd2625 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts @@ -5,8 +5,9 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared/abstract-comm export class ConfigCommand extends AbstractCommand { - static getCustomConfigResolutions (enabled: boolean) { + static getCustomConfigResolutions (enabled: boolean, with0p = false) { return { + '0p': enabled && with0p, '144p': enabled, '240p': enabled, '360p': enabled, @@ -31,13 +32,13 @@ export class ConfigCommand extends AbstractCommand { // --------------------------------------------------------------------------- - enableSignup (requiresApproval: boolean) { + enableSignup (requiresApproval: boolean, limit = -1) { return this.updateExistingSubConfig({ newConfig: { signup: { enabled: true, requiresApproval, - limit: -1 + limit } } }) @@ -129,7 +130,8 @@ export class ConfigCommand extends AbstractCommand { }) } - enableTranscoding (webtorrent = true, hls = true) { + // TODO: convert args to object + enableTranscoding (webtorrent = true, hls = true, with0p = false) { return this.updateExistingSubConfig({ newConfig: { transcoding: { @@ -138,7 +140,7 @@ export class ConfigCommand extends AbstractCommand { allowAudioFiles: true, allowAdditionalExtensions: true, - resolutions: ConfigCommand.getCustomConfigResolutions(true), + resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), webtorrent: { enabled: webtorrent @@ -151,6 +153,7 @@ export class ConfigCommand extends AbstractCommand { }) } + // TODO: convert args to object enableMinimumTranscoding (webtorrent = true, hls = true) { return this.updateExistingSubConfig({ newConfig: { @@ -173,6 +176,37 @@ export class ConfigCommand extends AbstractCommand { }) } + enableRemoteTranscoding () { + return this.updateExistingSubConfig({ + newConfig: { + transcoding: { + remoteRunners: { + enabled: true + } + }, + live: { + transcoding: { + remoteRunners: { + enabled: true + } + } + } + } + }) + } + + enableRemoteStudio () { + return this.updateExistingSubConfig({ + newConfig: { + videoStudio: { + remoteRunners: { + enabled: true + } + } + } + }) + } + // --------------------------------------------------------------------------- enableStudio () { @@ -350,6 +384,11 @@ export class ConfigCommand extends AbstractCommand { enabled: true }, user: { + history: { + videos: { + enabled: true + } + }, videoQuota: 5242881, videoQuotaDaily: 318742 }, @@ -358,6 +397,9 @@ export class ConfigCommand extends AbstractCommand { }, transcoding: { enabled: true, + remoteRunners: { + enabled: false + }, allowAdditionalExtensions: true, allowAudioFiles: true, threads: 1, @@ -393,6 +435,9 @@ export class ConfigCommand extends AbstractCommand { maxUserLives: 50, transcoding: { enabled: true, + remoteRunners: { + enabled: false + }, threads: 4, profile: 'default', resolutions: { @@ -409,7 +454,10 @@ export class ConfigCommand extends AbstractCommand { } }, videoStudio: { - enabled: false + enabled: false, + remoteRunners: { + enabled: false + } }, import: { videos: {