]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/server/config-command.ts
Translated using Weblate (Persian)
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / config-command.ts
index 51267b85b31088a63ecac17e1020b0a7cdad2e49..b94bd2625a9cefea6b01def9c5a20c32f90d03e6 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,
@@ -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: {