2021-02-10 11:06:32 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
import omit from 'lodash-es/omit'
|
2021-02-10 11:42:10 +01:00
|
|
|
import { forkJoin } from 'rxjs'
|
|
|
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
2021-02-10 11:06:32 +01:00
|
|
|
import { Component, OnInit } from '@angular/core'
|
2021-02-10 09:19:36 +01:00
|
|
|
import { ActivatedRoute, Router } from '@angular/router'
|
2020-06-23 14:10:17 +02:00
|
|
|
import { ConfigService } from '@app/+admin/config/shared/config.service'
|
|
|
|
import { Notifier } from '@app/core'
|
|
|
|
import { ServerService } from '@app/core/server/server.service'
|
2020-08-11 16:07:53 +02:00
|
|
|
import {
|
2020-08-17 11:47:04 +02:00
|
|
|
ADMIN_EMAIL_VALIDATOR,
|
|
|
|
CACHE_CAPTIONS_SIZE_VALIDATOR,
|
|
|
|
CACHE_PREVIEWS_SIZE_VALIDATOR,
|
2021-02-08 10:51:10 +01:00
|
|
|
CONCURRENCY_VALIDATOR,
|
2020-08-17 11:47:04 +02:00
|
|
|
INDEX_URL_VALIDATOR,
|
|
|
|
INSTANCE_NAME_VALIDATOR,
|
|
|
|
INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
|
2021-02-10 11:42:10 +01:00
|
|
|
MAX_INSTANCE_LIVES_VALIDATOR,
|
|
|
|
MAX_LIVE_DURATION_VALIDATOR,
|
|
|
|
MAX_USER_LIVES_VALIDATOR,
|
2022-10-07 15:26:53 +02:00
|
|
|
MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR,
|
2020-08-17 11:47:04 +02:00
|
|
|
SEARCH_INDEX_URL_VALIDATOR,
|
|
|
|
SERVICES_TWITTER_USERNAME_VALIDATOR,
|
|
|
|
SIGNUP_LIMIT_VALIDATOR,
|
2021-04-24 11:57:01 +02:00
|
|
|
SIGNUP_MINIMUM_AGE_VALIDATOR,
|
2022-10-07 15:26:53 +02:00
|
|
|
TRANSCODING_THREADS_VALIDATOR
|
2020-08-17 11:47:04 +02:00
|
|
|
} from '@app/shared/form-validators/custom-config-validators'
|
|
|
|
import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
|
2022-10-07 15:26:53 +02:00
|
|
|
import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
|
2021-05-27 15:59:55 +02:00
|
|
|
import { CustomPageService } from '@app/shared/shared-main/custom-page'
|
2021-06-04 13:31:41 +02:00
|
|
|
import { CustomConfig, CustomPage, HTMLServerConfig } from '@shared/models'
|
2021-02-10 11:06:32 +01:00
|
|
|
import { EditConfigurationService } from './edit-configuration.service'
|
2018-01-17 10:32:03 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
type ComponentCustomConfig = CustomConfig & {
|
|
|
|
instanceCustomHomepage: CustomPage
|
|
|
|
}
|
|
|
|
|
2018-01-17 10:32:03 +01:00
|
|
|
@Component({
|
|
|
|
selector: 'my-edit-custom-config',
|
|
|
|
templateUrl: './edit-custom-config.component.html',
|
|
|
|
styleUrls: [ './edit-custom-config.component.scss' ]
|
|
|
|
})
|
2021-02-10 11:06:32 +01:00
|
|
|
export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
|
|
|
activeNav: string
|
2020-03-11 19:38:17 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
customConfig: ComponentCustomConfig
|
2021-06-04 13:31:41 +02:00
|
|
|
serverConfig: HTMLServerConfig
|
2021-01-28 16:10:09 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
homepage: CustomPage
|
|
|
|
|
2020-08-11 16:07:53 +02:00
|
|
|
languageItems: SelectOptionsItem[] = []
|
|
|
|
categoryItems: SelectOptionsItem[] = []
|
2019-08-23 15:23:27 +02:00
|
|
|
|
2018-01-17 10:32:03 +01:00
|
|
|
constructor (
|
2022-10-07 15:26:53 +02:00
|
|
|
protected formReactiveService: FormReactiveService,
|
2021-02-10 09:19:36 +01:00
|
|
|
private router: Router,
|
|
|
|
private route: ActivatedRoute,
|
2018-12-19 16:04:34 +01:00
|
|
|
private notifier: Notifier,
|
2018-01-17 10:32:03 +01:00
|
|
|
private configService: ConfigService,
|
2021-05-27 15:59:55 +02:00
|
|
|
private customPage: CustomPageService,
|
2021-02-10 11:06:32 +01:00
|
|
|
private serverService: ServerService,
|
|
|
|
private editConfigurationService: EditConfigurationService
|
2018-01-17 10:32:03 +01:00
|
|
|
) {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
2018-06-05 10:58:45 +02:00
|
|
|
ngOnInit () {
|
2021-06-04 13:31:41 +02:00
|
|
|
this.serverConfig = this.serverService.getHTMLConfig()
|
2019-12-18 15:31:54 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
const formGroupData: { [key in keyof ComponentCustomConfig ]: any } = {
|
2019-01-10 09:58:08 +01:00
|
|
|
instance: {
|
2020-08-17 11:47:04 +02:00
|
|
|
name: INSTANCE_NAME_VALIDATOR,
|
|
|
|
shortDescription: INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
|
2019-01-10 09:58:08 +01:00
|
|
|
description: null,
|
2019-08-23 15:23:27 +02:00
|
|
|
|
2019-02-20 15:36:43 +01:00
|
|
|
isNSFW: false,
|
2019-01-10 09:58:08 +01:00
|
|
|
defaultNSFWPolicy: null,
|
2019-08-23 15:23:27 +02:00
|
|
|
|
|
|
|
terms: null,
|
|
|
|
codeOfConduct: null,
|
2019-09-03 09:49:04 +02:00
|
|
|
|
|
|
|
creationReason: null,
|
2019-08-23 15:23:27 +02:00
|
|
|
moderationInformation: null,
|
|
|
|
administrator: null,
|
|
|
|
maintenanceLifetime: null,
|
|
|
|
businessModel: null,
|
|
|
|
|
2019-09-05 09:43:35 +02:00
|
|
|
hardwareInformation: null,
|
|
|
|
|
2019-08-23 15:23:27 +02:00
|
|
|
categories: null,
|
|
|
|
languages: null,
|
|
|
|
|
|
|
|
defaultClientRoute: null,
|
|
|
|
|
2019-01-10 09:58:08 +01:00
|
|
|
customizations: {
|
|
|
|
javascript: null,
|
|
|
|
css: null
|
|
|
|
}
|
|
|
|
},
|
2019-07-09 11:45:19 +02:00
|
|
|
theme: {
|
|
|
|
default: null
|
|
|
|
},
|
2019-01-10 09:58:08 +01:00
|
|
|
services: {
|
|
|
|
twitter: {
|
2020-08-17 11:47:04 +02:00
|
|
|
username: SERVICES_TWITTER_USERNAME_VALIDATOR,
|
2019-01-10 09:58:08 +01:00
|
|
|
whitelisted: null
|
|
|
|
}
|
|
|
|
},
|
2021-12-03 17:04:47 +01:00
|
|
|
client: {
|
|
|
|
videos: {
|
|
|
|
miniature: {
|
|
|
|
preferAuthorDisplayName: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
menu: {
|
|
|
|
login: {
|
|
|
|
redirectOnSingleExternalAuth: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-01-10 09:58:08 +01:00
|
|
|
cache: {
|
|
|
|
previews: {
|
2020-08-17 11:47:04 +02:00
|
|
|
size: CACHE_PREVIEWS_SIZE_VALIDATOR
|
2019-01-10 09:58:08 +01:00
|
|
|
},
|
|
|
|
captions: {
|
2020-08-17 11:47:04 +02:00
|
|
|
size: CACHE_CAPTIONS_SIZE_VALIDATOR
|
2021-02-18 11:07:08 +01:00
|
|
|
},
|
|
|
|
torrents: {
|
|
|
|
size: CACHE_CAPTIONS_SIZE_VALIDATOR
|
2019-01-10 09:58:08 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
signup: {
|
|
|
|
enabled: null,
|
2020-08-17 11:47:04 +02:00
|
|
|
limit: SIGNUP_LIMIT_VALIDATOR,
|
2023-01-19 09:29:47 +01:00
|
|
|
requiresApproval: null,
|
2021-04-24 11:57:01 +02:00
|
|
|
requiresEmailVerification: null,
|
|
|
|
minimumAge: SIGNUP_MINIMUM_AGE_VALIDATOR
|
2019-01-10 09:58:08 +01:00
|
|
|
},
|
|
|
|
import: {
|
|
|
|
videos: {
|
2021-02-08 10:51:10 +01:00
|
|
|
concurrency: CONCURRENCY_VALIDATOR,
|
2019-01-10 09:58:08 +01:00
|
|
|
http: {
|
|
|
|
enabled: null
|
|
|
|
},
|
|
|
|
torrent: {
|
|
|
|
enabled: null
|
|
|
|
}
|
2022-08-10 09:53:39 +02:00
|
|
|
},
|
|
|
|
videoChannelSynchronization: {
|
|
|
|
enabled: null
|
2019-01-10 09:58:08 +01:00
|
|
|
}
|
|
|
|
},
|
2021-01-27 17:15:21 +01:00
|
|
|
trending: {
|
|
|
|
videos: {
|
|
|
|
algorithms: {
|
|
|
|
enabled: null,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-01-10 09:58:08 +01:00
|
|
|
admin: {
|
2020-08-17 11:47:04 +02:00
|
|
|
email: ADMIN_EMAIL_VALIDATOR
|
2019-01-10 09:58:08 +01:00
|
|
|
},
|
|
|
|
contactForm: {
|
|
|
|
enabled: null
|
|
|
|
},
|
|
|
|
user: {
|
2023-04-07 10:09:54 +02:00
|
|
|
history: {
|
|
|
|
videos: {
|
|
|
|
enabled: null
|
|
|
|
}
|
|
|
|
},
|
2020-08-17 11:47:04 +02:00
|
|
|
videoQuota: USER_VIDEO_QUOTA_VALIDATOR,
|
|
|
|
videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR
|
2019-01-10 09:58:08 +01:00
|
|
|
},
|
2021-10-26 16:42:10 +02:00
|
|
|
videoChannels: {
|
|
|
|
maxPerUser: MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR
|
|
|
|
},
|
2019-01-10 09:58:08 +01:00
|
|
|
transcoding: {
|
|
|
|
enabled: null,
|
2020-08-17 11:47:04 +02:00
|
|
|
threads: TRANSCODING_THREADS_VALIDATOR,
|
2019-01-10 09:58:08 +01:00
|
|
|
allowAdditionalExtensions: null,
|
2019-05-16 16:55:34 +02:00
|
|
|
allowAudioFiles: null,
|
2021-01-28 16:10:09 +01:00
|
|
|
profile: null,
|
2021-02-08 10:51:10 +01:00
|
|
|
concurrency: CONCURRENCY_VALIDATOR,
|
2019-11-05 10:13:37 +01:00
|
|
|
resolutions: {},
|
2022-08-05 10:36:19 +02:00
|
|
|
alwaysTranscodeOriginalResolution: null,
|
2019-11-05 10:13:37 +01:00
|
|
|
hls: {
|
|
|
|
enabled: null
|
2019-11-21 17:01:24 +01:00
|
|
|
},
|
|
|
|
webtorrent: {
|
|
|
|
enabled: null
|
2023-04-21 15:04:52 +02:00
|
|
|
},
|
|
|
|
remoteRunners: {
|
|
|
|
enabled: null
|
2019-11-05 10:13:37 +01:00
|
|
|
}
|
2019-04-02 11:26:47 +02:00
|
|
|
},
|
2020-09-17 09:20:52 +02:00
|
|
|
live: {
|
|
|
|
enabled: null,
|
|
|
|
|
2021-02-10 11:42:10 +01:00
|
|
|
maxDuration: MAX_LIVE_DURATION_VALIDATOR,
|
|
|
|
maxInstanceLives: MAX_INSTANCE_LIVES_VALIDATOR,
|
|
|
|
maxUserLives: MAX_USER_LIVES_VALIDATOR,
|
2020-09-25 16:19:35 +02:00
|
|
|
allowReplay: null,
|
2022-03-04 13:40:02 +01:00
|
|
|
latencySetting: {
|
|
|
|
enabled: null
|
|
|
|
},
|
2020-09-25 16:19:35 +02:00
|
|
|
|
2020-09-17 09:20:52 +02:00
|
|
|
transcoding: {
|
|
|
|
enabled: null,
|
|
|
|
threads: TRANSCODING_THREADS_VALIDATOR,
|
2021-01-28 16:10:09 +01:00
|
|
|
profile: null,
|
2022-08-05 10:36:19 +02:00
|
|
|
resolutions: {},
|
2023-04-21 15:04:52 +02:00
|
|
|
alwaysTranscodeOriginalResolution: null,
|
|
|
|
remoteRunners: {
|
|
|
|
enabled: null
|
|
|
|
}
|
2020-09-17 09:20:52 +02:00
|
|
|
}
|
|
|
|
},
|
2022-03-22 16:58:49 +01:00
|
|
|
videoStudio: {
|
2023-05-04 15:29:34 +02:00
|
|
|
enabled: null,
|
|
|
|
remoteRunners: {
|
|
|
|
enabled: null
|
|
|
|
}
|
2022-02-11 10:51:33 +01:00
|
|
|
},
|
2019-04-02 11:26:47 +02:00
|
|
|
autoBlacklist: {
|
|
|
|
videos: {
|
|
|
|
ofUsers: {
|
|
|
|
enabled: null
|
|
|
|
}
|
|
|
|
}
|
2019-04-08 15:47:44 +02:00
|
|
|
},
|
|
|
|
followers: {
|
|
|
|
instance: {
|
|
|
|
enabled: null,
|
|
|
|
manualApproval: null
|
|
|
|
}
|
2019-09-04 14:30:34 +02:00
|
|
|
},
|
|
|
|
followings: {
|
|
|
|
instance: {
|
|
|
|
autoFollowBack: {
|
|
|
|
enabled: null
|
|
|
|
},
|
|
|
|
autoFollowIndex: {
|
|
|
|
enabled: null,
|
2020-08-17 11:47:04 +02:00
|
|
|
indexUrl: INDEX_URL_VALIDATOR
|
2019-09-04 14:30:34 +02:00
|
|
|
}
|
|
|
|
}
|
2020-05-28 11:15:38 +02:00
|
|
|
},
|
|
|
|
broadcastMessage: {
|
|
|
|
enabled: null,
|
|
|
|
level: null,
|
|
|
|
dismissable: null,
|
|
|
|
message: null
|
2020-05-29 16:16:24 +02:00
|
|
|
},
|
|
|
|
search: {
|
|
|
|
remoteUri: {
|
|
|
|
users: null,
|
|
|
|
anonymous: null
|
|
|
|
},
|
|
|
|
searchIndex: {
|
|
|
|
enabled: null,
|
2020-08-17 11:47:04 +02:00
|
|
|
url: SEARCH_INDEX_URL_VALIDATOR,
|
2020-05-29 16:16:24 +02:00
|
|
|
disableLocalSearch: null,
|
|
|
|
isDefaultSearch: null
|
|
|
|
}
|
2021-05-27 15:59:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
instanceCustomHomepage: {
|
|
|
|
content: null
|
2019-01-10 09:58:08 +01:00
|
|
|
}
|
2018-01-17 10:32:03 +01:00
|
|
|
}
|
|
|
|
|
2019-01-10 09:58:08 +01:00
|
|
|
const defaultValues = {
|
|
|
|
transcoding: {
|
2023-05-24 16:48:54 +02:00
|
|
|
resolutions: {} as { [id: string]: string }
|
2020-09-17 09:20:52 +02:00
|
|
|
},
|
|
|
|
live: {
|
|
|
|
transcoding: {
|
2023-05-24 16:48:54 +02:00
|
|
|
resolutions: {} as { [id: string]: string }
|
2020-09-17 09:20:52 +02:00
|
|
|
}
|
2019-01-10 09:58:08 +01:00
|
|
|
}
|
|
|
|
}
|
2020-09-17 09:20:52 +02:00
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
for (const resolution of this.editConfigurationService.getVODResolutions()) {
|
2019-06-12 17:26:23 +02:00
|
|
|
defaultValues.transcoding.resolutions[resolution.id] = 'false'
|
|
|
|
formGroupData.transcoding.resolutions[resolution.id] = null
|
2018-01-17 10:32:03 +01:00
|
|
|
}
|
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
for (const resolution of this.editConfigurationService.getLiveResolutions()) {
|
2020-09-17 09:20:52 +02:00
|
|
|
defaultValues.live.transcoding.resolutions[resolution.id] = 'false'
|
|
|
|
formGroupData.live.transcoding.resolutions[resolution.id] = null
|
|
|
|
}
|
|
|
|
|
2018-06-05 10:58:45 +02:00
|
|
|
this.buildForm(formGroupData)
|
2020-11-18 15:55:19 +01:00
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
if (this.route.snapshot.fragment) {
|
|
|
|
this.onNavChange(this.route.snapshot.fragment)
|
2020-03-11 19:38:17 +01:00
|
|
|
}
|
2020-05-29 16:16:24 +02:00
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
this.loadConfigAndUpdateForm()
|
|
|
|
this.loadCategoriesAndLanguages()
|
2021-10-14 11:35:43 +02:00
|
|
|
|
|
|
|
if (!this.isUpdateAllowed()) {
|
2021-10-12 13:33:44 +02:00
|
|
|
this.form.disable()
|
|
|
|
}
|
2021-01-26 01:53:13 +01:00
|
|
|
}
|
|
|
|
|
2021-08-25 16:14:11 +02:00
|
|
|
formValidated () {
|
2022-09-07 16:24:44 +02:00
|
|
|
this.forceCheck()
|
|
|
|
if (!this.form.valid) return
|
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
const value: ComponentCustomConfig = this.form.getRawValue()
|
2020-11-10 14:15:59 +01:00
|
|
|
|
2021-05-27 15:59:55 +02:00
|
|
|
forkJoin([
|
|
|
|
this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')),
|
|
|
|
this.customPage.updateInstanceHomepage(value.instanceCustomHomepage.content)
|
|
|
|
])
|
2021-08-17 11:27:47 +02:00
|
|
|
.subscribe({
|
|
|
|
next: ([ resConfig ]) => {
|
2021-05-27 15:59:55 +02:00
|
|
|
const instanceCustomHomepage = {
|
|
|
|
content: value.instanceCustomHomepage.content
|
|
|
|
}
|
|
|
|
|
|
|
|
this.customConfig = { ...resConfig, instanceCustomHomepage }
|
2018-01-17 10:32:03 +01:00
|
|
|
|
|
|
|
// Reload general configuration
|
2019-12-18 15:31:54 +01:00
|
|
|
this.serverService.resetConfig()
|
2021-08-17 14:42:53 +02:00
|
|
|
.subscribe(config => {
|
|
|
|
this.serverConfig = config
|
|
|
|
})
|
2018-01-17 10:32:03 +01:00
|
|
|
|
|
|
|
this.updateForm()
|
2018-01-31 16:42:40 +01:00
|
|
|
|
2020-08-12 10:40:04 +02:00
|
|
|
this.notifier.success($localize`Configuration updated.`)
|
2018-01-17 10:32:03 +01:00
|
|
|
},
|
|
|
|
|
2021-08-17 11:27:47 +02:00
|
|
|
error: err => this.notifier.error(err.message)
|
|
|
|
})
|
2018-01-17 10:32:03 +01:00
|
|
|
}
|
|
|
|
|
2021-10-14 11:35:43 +02:00
|
|
|
isUpdateAllowed () {
|
|
|
|
return this.serverConfig.webadmin.configuration.edition.allowed === true
|
|
|
|
}
|
|
|
|
|
2020-09-25 16:19:35 +02:00
|
|
|
hasConsistentOptions () {
|
|
|
|
if (this.hasLiveAllowReplayConsistentOptions()) return true
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
hasLiveAllowReplayConsistentOptions () {
|
2021-02-10 11:06:32 +01:00
|
|
|
if (
|
|
|
|
this.editConfigurationService.isTranscodingEnabled(this.form) === false &&
|
|
|
|
this.editConfigurationService.isLiveEnabled(this.form) &&
|
|
|
|
this.form.value['live']['allowReplay'] === true
|
|
|
|
) {
|
2020-09-25 16:19:35 +02:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2021-02-10 09:19:36 +01:00
|
|
|
onNavChange (newActiveNav: string) {
|
|
|
|
this.activeNav = newActiveNav
|
|
|
|
|
|
|
|
this.router.navigate([], { fragment: this.activeNav })
|
|
|
|
}
|
|
|
|
|
2021-02-10 12:06:26 +01:00
|
|
|
grabAllErrors (errorObjectArg?: any) {
|
|
|
|
const errorObject = errorObjectArg || this.formErrors
|
|
|
|
|
|
|
|
let acc: string[] = []
|
|
|
|
|
|
|
|
for (const key of Object.keys(errorObject)) {
|
|
|
|
const value = errorObject[key]
|
|
|
|
if (!value) continue
|
|
|
|
|
|
|
|
if (typeof value === 'string') {
|
|
|
|
acc.push(value)
|
|
|
|
} else {
|
|
|
|
acc = acc.concat(this.grabAllErrors(value))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return acc
|
|
|
|
}
|
|
|
|
|
2018-01-17 10:32:03 +01:00
|
|
|
private updateForm () {
|
2019-01-10 09:58:08 +01:00
|
|
|
this.form.patchValue(this.customConfig)
|
2018-01-17 10:32:03 +01:00
|
|
|
}
|
2020-01-06 16:43:15 +01:00
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
private loadConfigAndUpdateForm () {
|
2021-05-27 15:59:55 +02:00
|
|
|
forkJoin([
|
|
|
|
this.configService.getCustomConfig(),
|
|
|
|
this.customPage.getInstanceHomepage()
|
2021-08-17 11:27:47 +02:00
|
|
|
]).subscribe({
|
|
|
|
next: ([ config, homepage ]) => {
|
2021-05-27 15:59:55 +02:00
|
|
|
this.customConfig = { ...config, instanceCustomHomepage: homepage }
|
2020-01-06 16:43:15 +01:00
|
|
|
|
|
|
|
this.updateForm()
|
2022-09-07 16:24:44 +02:00
|
|
|
this.markAllAsDirty()
|
2020-01-06 16:43:15 +01:00
|
|
|
},
|
|
|
|
|
2021-08-17 11:27:47 +02:00
|
|
|
error: err => this.notifier.error(err.message)
|
|
|
|
})
|
2020-01-06 16:43:15 +01:00
|
|
|
}
|
|
|
|
|
2021-02-10 11:06:32 +01:00
|
|
|
private loadCategoriesAndLanguages () {
|
|
|
|
forkJoin([
|
|
|
|
this.serverService.getVideoLanguages(),
|
|
|
|
this.serverService.getVideoCategories()
|
2021-08-17 11:27:47 +02:00
|
|
|
]).subscribe({
|
|
|
|
next: ([ languages, categories ]) => {
|
2021-02-10 11:06:32 +01:00
|
|
|
this.languageItems = languages.map(l => ({ label: l.label, id: l.id }))
|
|
|
|
this.categoryItems = categories.map(l => ({ label: l.label, id: l.id + '' }))
|
|
|
|
},
|
2020-11-18 15:55:19 +01:00
|
|
|
|
2021-08-17 11:27:47 +02:00
|
|
|
error: err => this.notifier.error(err.message)
|
|
|
|
})
|
2020-11-18 15:55:19 +01:00
|
|
|
}
|
2018-01-17 10:32:03 +01:00
|
|
|
}
|