]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/server/config-command.ts
Add runner server tests
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / config-command.ts
index 303fcab88adc02e8d1fc85877791a9e0410cd90c..9a6e413f2b4ecdcd70a23c1bf34850aa7ec3519a 100644 (file)
@@ -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,
@@ -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,25 @@ export class ConfigCommand extends AbstractCommand {
     })
   }
 
+  enableRemoteTranscoding () {
+    return this.updateExistingSubConfig({
+      newConfig: {
+        transcoding: {
+          remoteRunners: {
+            enabled: true
+          }
+        },
+        live: {
+          transcoding: {
+            remoteRunners: {
+              enabled: true
+            }
+          }
+        }
+      }
+    })
+  }
+
   // ---------------------------------------------------------------------------
 
   enableStudio () {
@@ -363,6 +385,9 @@ export class ConfigCommand extends AbstractCommand {
       },
       transcoding: {
         enabled: true,
+        remoteRunners: {
+          enabled: false
+        },
         allowAdditionalExtensions: true,
         allowAudioFiles: true,
         threads: 1,
@@ -398,6 +423,9 @@ export class ConfigCommand extends AbstractCommand {
         maxUserLives: 50,
         transcoding: {
           enabled: true,
+          remoteRunners: {
+            enabled: false
+          },
           threads: 4,
           profile: 'default',
           resolutions: {