1 import { ServerService } from '../../../core'
2 import { FormReactive } from '../../../shared'
3 import { VideoResolution } from '../../../../../../shared/models/videos/video-resolution.enum'
5 export abstract class UserEdit extends FormReactive {
7 { value: -1, label: 'Unlimited' },
8 { value: 0, label: '0'},
9 { value: 100 * 1024 * 1024, label: '100MB' },
10 { value: 500 * 1024 * 1024, label: '500MB' },
11 { value: 1024 * 1024 * 1024, label: '1GB' },
12 { value: 5 * 1024 * 1024 * 1024, label: '5GB' },
13 { value: 20 * 1024 * 1024 * 1024, label: '20GB' },
14 { value: 50 * 1024 * 1024 * 1024, label: '50GB' }
17 protected abstract serverService: ServerService
18 abstract isCreation (): boolean
19 abstract getFormButtonTitle (): string
21 isTranscodingInformationDisplayed () {
22 const formVideoQuota = parseInt(this.form.value['videoQuota'], 10)
24 return this.serverService.getConfig().transcoding.enabledResolutions.length !== 0 &&
28 computeQuotaWithTranscoding () {
29 const resolutions = this.serverService.getConfig().transcoding.enabledResolutions
30 const higherResolution = VideoResolution.H_1080P
33 for (const resolution of resolutions) {
34 multiplier += resolution / higherResolution
37 return multiplier * parseInt(this.form.value['videoQuota'], 10)