diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-14 12:47:10 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-14 14:34:34 +0100 |
commit | ea5cdc11ff76d6292351ffc5dbbd00e44bfd7cca (patch) | |
tree | 9bd2c44ef4b74db43e3d5c22b598212132896b6a /client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |
parent | 421fd8533750e49e3fad497f0a30c950375e9e69 (diff) | |
download | PeerTube-ea5cdc11ff76d6292351ffc5dbbd00e44bfd7cca.tar.gz PeerTube-ea5cdc11ff76d6292351ffc5dbbd00e44bfd7cca.tar.zst PeerTube-ea5cdc11ff76d6292351ffc5dbbd00e44bfd7cca.zip |
slightly clearer layout of transcoding configuration
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 7db65d038..7920600fc 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -119,6 +119,30 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
119 | .map(t => t.name) | 119 | .map(t => t.name) |
120 | } | 120 | } |
121 | 121 | ||
122 | getTotalTranscodingThreads () { | ||
123 | const transcodingEnabled = this.form.value['transcoding']['enabled'] | ||
124 | const transcodingThreads = this.form.value['transcoding']['threads'] | ||
125 | const liveTranscodingEnabled = this.form.value['live']['transcoding']['enabled'] | ||
126 | const liveTranscodingThreads = this.form.value['live']['transcoding']['threads'] | ||
127 | |||
128 | // checks whether all enabled method are on fixed values and not on auto (= 0) | ||
129 | let noneOnAuto = !transcodingEnabled || +transcodingThreads > 0 | ||
130 | noneOnAuto &&= !liveTranscodingEnabled || +liveTranscodingThreads > 0 | ||
131 | |||
132 | // count total of fixed value, repalcing auto by a single thread (knowing it will display "at least") | ||
133 | let value = 0 | ||
134 | if (transcodingEnabled) value += +transcodingThreads || 1 | ||
135 | if (liveTranscodingEnabled) value += +liveTranscodingThreads || 1 | ||
136 | |||
137 | return { | ||
138 | value, | ||
139 | atMost: noneOnAuto, // auto switches everything to a least estimation since ffmpeg will take as many threads as possible | ||
140 | unit: value > 1 | ||
141 | ? $localize`threads` | ||
142 | : $localize`thread` | ||
143 | } | ||
144 | } | ||
145 | |||
122 | getResolutionKey (resolution: string) { | 146 | getResolutionKey (resolution: string) { |
123 | return 'transcoding.resolutions.' + resolution | 147 | return 'transcoding.resolutions.' + resolution |
124 | } | 148 | } |