]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/config/edit-custom-config/edit-configuration.service.ts
Improve remote runner config UX
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-configuration.service.ts
index 9b55cb43cdb9c34b6d5c9866cd84d3862a1040e5..628c2d10268a6af664017211ec5486275aabb6ba 100644 (file)
@@ -1,5 +1,6 @@
 import { Injectable } from '@angular/core'
 import { FormGroup } from '@angular/forms'
+import { prepareIcu } from '@app/helpers'
 
 export type ResolutionOption = {
   id: string
@@ -60,6 +61,18 @@ export class EditConfigurationService {
     return form.value['transcoding']['enabled'] === true
   }
 
+  isRemoteRunnerVODEnabled (form: FormGroup) {
+    return form.value['transcoding']['remoteRunners']['enabled'] === true
+  }
+
+  isRemoteRunnerLiveEnabled (form: FormGroup) {
+    return form.value['live']['transcoding']['remoteRunners']['enabled'] === true
+  }
+
+  isStudioEnabled (form: FormGroup) {
+    return form.value['videoStudio']['enabled'] === true
+  }
+
   isLiveEnabled (form: FormGroup) {
     return form.value['live']['enabled'] === true
   }
@@ -86,9 +99,10 @@ export class EditConfigurationService {
     return {
       value,
       atMost: noneOnAuto, // auto switches everything to a least estimation since ffmpeg will take as many threads as possible
-      unit: value > 1
-        ? $localize`threads`
-        : $localize`thread`
+      unit: prepareIcu($localize`{value, plural, =1 {thread} other {threads}}`)(
+        { value },
+        $localize`threads`
+      )
     }
   }
 }