Fix updating transcoding profiles
This commit is contained in:
parent
4c7449d2ad
commit
b06f1ead3b
|
@ -153,7 +153,7 @@
|
|||
<my-select-options
|
||||
id="liveTranscodingProfile"
|
||||
formControlName="profile"
|
||||
[items]="getAvailableTranscodingProfile()"
|
||||
[items]="transcodingProfiles"
|
||||
[clearable]="false"
|
||||
>
|
||||
</my-select-options>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||
import { Component, Input, OnInit } from '@angular/core'
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||
import { FormGroup } from '@angular/forms'
|
||||
import { ServerConfig } from '@shared/models'
|
||||
import { ConfigService } from '../shared/config.service'
|
||||
|
@ -11,12 +11,14 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
|||
templateUrl: './edit-live-configuration.component.html',
|
||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||
})
|
||||
export class EditLiveConfigurationComponent implements OnInit {
|
||||
export class EditLiveConfigurationComponent implements OnInit, OnChanges {
|
||||
@Input() form: FormGroup
|
||||
@Input() formErrors: any
|
||||
@Input() serverConfig: ServerConfig
|
||||
|
||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||
transcodingProfiles: SelectOptionsItem[] = []
|
||||
|
||||
liveMaxDurationOptions: SelectOptionsItem[] = []
|
||||
liveResolutions: ResolutionOption[] = []
|
||||
|
||||
|
@ -39,7 +41,13 @@ export class EditLiveConfigurationComponent implements OnInit {
|
|||
this.liveResolutions = this.editConfigurationService.getLiveResolutions()
|
||||
}
|
||||
|
||||
getAvailableTranscodingProfile () {
|
||||
ngOnChanges (changes: SimpleChanges) {
|
||||
if (changes['serverConfig']) {
|
||||
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||
}
|
||||
}
|
||||
|
||||
buildAvailableTranscodingProfile () {
|
||||
const profiles = this.serverConfig.live.transcoding.availableProfiles
|
||||
|
||||
return profiles.map(p => {
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
<my-select-options
|
||||
id="transcodingProfile"
|
||||
formControlName="profile"
|
||||
[items]="getAvailableTranscodingProfile()"
|
||||
[items]="transcodingProfiles"
|
||||
[clearable]="false"
|
||||
></my-select-options>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||
import { Component, Input, OnInit } from '@angular/core'
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||
import { FormGroup } from '@angular/forms'
|
||||
import { ServerConfig } from '@shared/models'
|
||||
import { ConfigService } from '../shared/config.service'
|
||||
|
@ -11,12 +11,13 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
|||
templateUrl: './edit-vod-transcoding.component.html',
|
||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||
})
|
||||
export class EditVODTranscodingComponent implements OnInit {
|
||||
export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||
@Input() form: FormGroup
|
||||
@Input() formErrors: any
|
||||
@Input() serverConfig: ServerConfig
|
||||
|
||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||
transcodingProfiles: SelectOptionsItem[] = []
|
||||
resolutions: ResolutionOption[] = []
|
||||
|
||||
constructor (
|
||||
|
@ -31,7 +32,13 @@ export class EditVODTranscodingComponent implements OnInit {
|
|||
this.checkTranscodingFields()
|
||||
}
|
||||
|
||||
getAvailableTranscodingProfile () {
|
||||
ngOnChanges (changes: SimpleChanges) {
|
||||
if (changes['serverConfig']) {
|
||||
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||
}
|
||||
}
|
||||
|
||||
buildAvailableTranscodingProfile () {
|
||||
const profiles = this.serverConfig.transcoding.availableProfiles
|
||||
|
||||
return profiles.map(p => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { DatePipe } from '@angular/common'
|
||||
import { Component, Input, OnChanges, OnInit } from '@angular/core'
|
||||
import { Component, Input, OnChanges } from '@angular/core'
|
||||
import { FromNowPipe } from '../angular/from-now.pipe'
|
||||
|
||||
@Component({
|
||||
|
@ -14,10 +13,7 @@ export class DateToggleComponent implements OnChanges {
|
|||
dateRelative: string
|
||||
dateAbsolute: string
|
||||
|
||||
constructor (
|
||||
private datePipe: DatePipe,
|
||||
private fromNowPipe: FromNowPipe
|
||||
) { }
|
||||
constructor (private fromNowPipe: FromNowPipe) { }
|
||||
|
||||
ngOnChanges () {
|
||||
this.updateDates()
|
||||
|
|
Loading…
Reference in New Issue