From f67ac646a2c081e02b28a7ab1dc856db6ee20e2f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Sep 2022 13:59:23 +0200 Subject: Put video quota info in its own component --- .../+admin/overview/users/user-edit/user-edit.ts | 27 ++++------------------ 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'client/src/app/+admin/overview/users/user-edit/user-edit.ts') diff --git a/client/src/app/+admin/overview/users/user-edit/user-edit.ts b/client/src/app/+admin/overview/users/user-edit/user-edit.ts index 395d07423..0ba517edb 100644 --- a/client/src/app/+admin/overview/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/overview/users/user-edit/user-edit.ts @@ -60,33 +60,14 @@ export abstract class UserEdit extends FormReactive implements OnInit { ] } - isTranscodingInformationDisplayed () { - const formVideoQuota = parseInt(this.form.value['videoQuota'], 10) - - return this.serverConfig.transcoding.enabledResolutions.length !== 0 && - formVideoQuota > 0 - } - - 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['videoQuota'], 10) - } - resetPassword () { return } + getUserVideoQuota () { + return this.form.value['videoQuota'] + } + protected buildAdminFlags (formValue: any) { return formValue.byPassAutoBlock ? UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST : UserAdminFlag.NONE } -- cgit v1.2.3