diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index 90ed58c99..dc7802b2c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | |||
@@ -3,7 +3,7 @@ import { SelectOptionsItem } from 'src/types/select-options-item.model' | |||
3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' | 3 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { MenuService, ThemeService } from '@app/core' | 5 | import { MenuService, ThemeService } from '@app/core' |
6 | import { HTMLServerConfig } from '@shared/models' | 6 | import { HTMLServerConfig, VideoResolution } from '@shared/models' |
7 | import { ConfigService } from '../shared/config.service' | 7 | import { ConfigService } from '../shared/config.service' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
@@ -92,6 +92,28 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges { | |||
92 | return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true | 92 | return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true |
93 | } | 93 | } |
94 | 94 | ||
95 | computeQuotaWithTranscoding () { | ||
96 | const transcodingConfig = this.serverConfig.transcoding | ||
97 | |||
98 | const resolutions = transcodingConfig.enabledResolutions | ||
99 | const higherResolution = VideoResolution.H_4K | ||
100 | let multiplier = 0 | ||
101 | |||
102 | for (const resolution of resolutions) { | ||
103 | multiplier += resolution / higherResolution | ||
104 | } | ||
105 | |||
106 | if (transcodingConfig.hls.enabled) multiplier *= 2 | ||
107 | |||
108 | return multiplier * parseInt(this.form.value['user']['videoQuota'], 10) | ||
109 | } | ||
110 | |||
111 | isTranscodingInformationDisplayed () { | ||
112 | const formVideoQuota = parseInt(this.form.value['user']['videoQuota'], 10) | ||
113 | return this.serverConfig.transcoding.enabledResolutions.length !== 0 && | ||
114 | formVideoQuota > 0 | ||
115 | } | ||
116 | |||
95 | buildLandingPageOptions () { | 117 | buildLandingPageOptions () { |
96 | this.defaultLandingPageOptions = this.menuService.buildCommonLinks(this.serverConfig) | 118 | this.defaultLandingPageOptions = this.menuService.buildCommonLinks(this.serverConfig) |
97 | .links | 119 | .links |