diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 15:00:01 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | d102de1b38f2877463529c3b27bd35ffef4fd8bf (patch) | |
tree | 31fa0bdf26ad7a2ee46d600d804a6f03260266c8 /shared/server-commands/server/config-command.ts | |
parent | 2fe978744e5b74eb824e4d79c1bb9b840169f125 (diff) | |
download | PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.gz PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.zst PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.zip |
Add runner server tests
Diffstat (limited to 'shared/server-commands/server/config-command.ts')
-rw-r--r-- | shared/server-commands/server/config-command.ts | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 303fcab88..9a6e413f2 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 | |||
5 | 5 | ||
6 | export class ConfigCommand extends AbstractCommand { | 6 | export class ConfigCommand extends AbstractCommand { |
7 | 7 | ||
8 | static getCustomConfigResolutions (enabled: boolean) { | 8 | static getCustomConfigResolutions (enabled: boolean, with0p = false) { |
9 | return { | 9 | return { |
10 | '0p': enabled && with0p, | ||
10 | '144p': enabled, | 11 | '144p': enabled, |
11 | '240p': enabled, | 12 | '240p': enabled, |
12 | '360p': enabled, | 13 | '360p': enabled, |
@@ -129,7 +130,8 @@ export class ConfigCommand extends AbstractCommand { | |||
129 | }) | 130 | }) |
130 | } | 131 | } |
131 | 132 | ||
132 | enableTranscoding (webtorrent = true, hls = true) { | 133 | // TODO: convert args to object |
134 | enableTranscoding (webtorrent = true, hls = true, with0p = false) { | ||
133 | return this.updateExistingSubConfig({ | 135 | return this.updateExistingSubConfig({ |
134 | newConfig: { | 136 | newConfig: { |
135 | transcoding: { | 137 | transcoding: { |
@@ -138,7 +140,7 @@ export class ConfigCommand extends AbstractCommand { | |||
138 | allowAudioFiles: true, | 140 | allowAudioFiles: true, |
139 | allowAdditionalExtensions: true, | 141 | allowAdditionalExtensions: true, |
140 | 142 | ||
141 | resolutions: ConfigCommand.getCustomConfigResolutions(true), | 143 | resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), |
142 | 144 | ||
143 | webtorrent: { | 145 | webtorrent: { |
144 | enabled: webtorrent | 146 | enabled: webtorrent |
@@ -151,6 +153,7 @@ export class ConfigCommand extends AbstractCommand { | |||
151 | }) | 153 | }) |
152 | } | 154 | } |
153 | 155 | ||
156 | // TODO: convert args to object | ||
154 | enableMinimumTranscoding (webtorrent = true, hls = true) { | 157 | enableMinimumTranscoding (webtorrent = true, hls = true) { |
155 | return this.updateExistingSubConfig({ | 158 | return this.updateExistingSubConfig({ |
156 | newConfig: { | 159 | newConfig: { |
@@ -173,6 +176,25 @@ export class ConfigCommand extends AbstractCommand { | |||
173 | }) | 176 | }) |
174 | } | 177 | } |
175 | 178 | ||
179 | enableRemoteTranscoding () { | ||
180 | return this.updateExistingSubConfig({ | ||
181 | newConfig: { | ||
182 | transcoding: { | ||
183 | remoteRunners: { | ||
184 | enabled: true | ||
185 | } | ||
186 | }, | ||
187 | live: { | ||
188 | transcoding: { | ||
189 | remoteRunners: { | ||
190 | enabled: true | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | } | ||
195 | }) | ||
196 | } | ||
197 | |||
176 | // --------------------------------------------------------------------------- | 198 | // --------------------------------------------------------------------------- |
177 | 199 | ||
178 | enableStudio () { | 200 | enableStudio () { |
@@ -363,6 +385,9 @@ export class ConfigCommand extends AbstractCommand { | |||
363 | }, | 385 | }, |
364 | transcoding: { | 386 | transcoding: { |
365 | enabled: true, | 387 | enabled: true, |
388 | remoteRunners: { | ||
389 | enabled: false | ||
390 | }, | ||
366 | allowAdditionalExtensions: true, | 391 | allowAdditionalExtensions: true, |
367 | allowAudioFiles: true, | 392 | allowAudioFiles: true, |
368 | threads: 1, | 393 | threads: 1, |
@@ -398,6 +423,9 @@ export class ConfigCommand extends AbstractCommand { | |||
398 | maxUserLives: 50, | 423 | maxUserLives: 50, |
399 | transcoding: { | 424 | transcoding: { |
400 | enabled: true, | 425 | enabled: true, |
426 | remoteRunners: { | ||
427 | enabled: false | ||
428 | }, | ||
401 | threads: 4, | 429 | threads: 4, |
402 | profile: 'default', | 430 | profile: 'default', |
403 | resolutions: { | 431 | resolutions: { |