X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Foverview%2Fusers%2Fuser-edit%2Fuser-edit.ts;h=6dae4110d43ef00baab89c243cdcc896bda887d3;hb=9c0cdc5047918b959ebd5e075ddad81eb7fb93f0;hp=395d0742370142d248e46eb7c16e27171f10a244;hpb=fba911e2c89708a166636e3a93fcd8fcbc3de7e1;p=github%2FChocobozzz%2FPeerTube.git 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..6dae4110d 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 @@ -3,7 +3,7 @@ import { ConfigService } from '@app/+admin/config/shared/config.service' import { AuthService, ScreenService, ServerService, User } from '@app/core' import { FormReactive } from '@app/shared/shared-forms' import { USER_ROLE_LABELS } from '@shared/core-utils/users' -import { HTMLServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' +import { HTMLServerConfig, UserAdminFlag, UserRole } from '@shared/models' import { SelectOptionsItem } from '../../../../../types/select-options-item.model' @Directive() @@ -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 }