]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts
Put video quota info in its own component
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-basic-configuration.component.ts
index dc7802b2c6dd699b61843a7c7b7433ad555f52a4..f7de4c7decaec6bccb03bc995cdf444c65fcfeb1 100644 (file)
@@ -60,6 +60,10 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges {
     return !!enabled.find((e: string) => e === algorithm)
   }
 
+  getUserVideoQuota () {
+    return this.form.value['user']['videoQuota']
+  }
+
   isSignupEnabled () {
     return this.form.value['signup']['enabled'] === true
   }
@@ -92,28 +96,6 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges {
     return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true
   }
 
-  computeQuotaWithTranscoding () {
-    const transcodingConfig = this.serverConfig.transcoding
-
-    const resolutions = transcodingConfig.enabledResolutions
-    const higherResolution = VideoResolution.H_4K
-    let multiplier = 0
-
-    for (const resolution of resolutions) {
-      multiplier += resolution / higherResolution
-    }
-
-    if (transcodingConfig.hls.enabled) multiplier *= 2
-
-    return multiplier * parseInt(this.form.value['user']['videoQuota'], 10)
-  }
-
-  isTranscodingInformationDisplayed () {
-    const formVideoQuota = parseInt(this.form.value['user']['videoQuota'], 10)
-    return this.serverConfig.transcoding.enabledResolutions.length !== 0 &&
-           formVideoQuota > 0
-  }
-
   buildLandingPageOptions () {
     this.defaultLandingPageOptions = this.menuService.buildCommonLinks(this.serverConfig)
       .links