aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-04 13:31:41 +0200
committerChocobozzz <me@florianbigard.com>2021-06-04 15:45:44 +0200
commit2989628b7913383b39ac34c7db8666a21f8e5037 (patch)
treeac7759177c04e524e7845143fd685aefb49e810e /client/src/app/+videos/+video-edit
parent8e08d415f9473b6b72fef698729453e726da16e7 (diff)
downloadPeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.gz
PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.zst
PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.zip
Use HTML config when possible
Diffstat (limited to 'client/src/app/+videos/+video-edit')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts4
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts9
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-send.ts8
-rw-r--r--client/src/app/+videos/+video-edit/video-add.component.ts9
4 files changed, 12 insertions, 18 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
index e48d16527..875911b91 100644
--- a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
@@ -4,7 +4,7 @@ import { VIDEO_CAPTION_FILE_VALIDATOR, VIDEO_CAPTION_LANGUAGE_VALIDATOR } from '
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { VideoCaptionEdit } from '@app/shared/shared-main' 5import { VideoCaptionEdit } from '@app/shared/shared-main'
6import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
7import { ServerConfig, VideoConstant } from '@shared/models' 7import { HTMLServerConfig, VideoConstant } from '@shared/models'
8 8
9@Component({ 9@Component({
10 selector: 'my-video-caption-add-modal', 10 selector: 'my-video-caption-add-modal',
@@ -14,7 +14,7 @@ import { ServerConfig, VideoConstant } from '@shared/models'
14 14
15export class VideoCaptionAddModalComponent extends FormReactive implements OnInit { 15export class VideoCaptionAddModalComponent extends FormReactive implements OnInit {
16 @Input() existingCaptions: string[] 16 @Input() existingCaptions: string[]
17 @Input() serverConfig: ServerConfig 17 @Input() serverConfig: HTMLServerConfig
18 18
19 @Output() captionAdded = new EventEmitter<VideoCaptionEdit>() 19 @Output() captionAdded = new EventEmitter<VideoCaptionEdit>()
20 20
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index 3d916dbce..52801802b 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -22,10 +22,10 @@ import { FormReactiveValidationMessages, FormValidatorService } from '@app/share
22import { InstanceService } from '@app/shared/shared-instance' 22import { InstanceService } from '@app/shared/shared-instance'
23import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' 23import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
24import { 24import {
25 HTMLServerConfig,
25 LiveVideo, 26 LiveVideo,
26 RegisterClientFormFieldOptions, 27 RegisterClientFormFieldOptions,
27 RegisterClientVideoFieldOptions, 28 RegisterClientVideoFieldOptions,
28 ServerConfig,
29 VideoConstant, 29 VideoConstant,
30 VideoDetails, 30 VideoDetails,
31 VideoPrivacy 31 VideoPrivacy
@@ -84,7 +84,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
84 calendarTimezone: string 84 calendarTimezone: string
85 calendarDateFormat: string 85 calendarDateFormat: string
86 86
87 serverConfig: ServerConfig 87 serverConfig: HTMLServerConfig
88 88
89 pluginFields: PluginField[] = [] 89 pluginFields: PluginField[] = []
90 90
@@ -194,9 +194,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
194 } 194 }
195 }) 195 })
196 196
197 this.serverConfig = this.serverService.getTmpConfig() 197
198 this.serverService.getConfig() 198 this.serverConfig = this.serverService.getHTMLConfig()
199 .subscribe(config => this.serverConfig = config)
200 199
201 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) 200 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)
202 201
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
index 3614499cd..a185892fe 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
@@ -6,7 +6,7 @@ import { listUserChannels } from '@app/helpers'
6import { FormReactive } from '@app/shared/shared-forms' 6import { FormReactive } from '@app/shared/shared-forms'
7import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' 7import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
8import { LoadingBarService } from '@ngx-loading-bar/core' 8import { LoadingBarService } from '@ngx-loading-bar/core'
9import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' 9import { HTMLServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
10 10
11@Directive() 11@Directive()
12// tslint:disable-next-line: directive-class-suffix 12// tslint:disable-next-line: directive-class-suffix
@@ -28,7 +28,7 @@ export abstract class VideoSend extends FormReactive implements OnInit {
28 protected serverService: ServerService 28 protected serverService: ServerService
29 protected videoService: VideoService 29 protected videoService: VideoService
30 protected videoCaptionService: VideoCaptionService 30 protected videoCaptionService: VideoCaptionService
31 protected serverConfig: ServerConfig 31 protected serverConfig: HTMLServerConfig
32 32
33 abstract canDeactivate (): CanComponentDeactivateResult 33 abstract canDeactivate (): CanComponentDeactivateResult
34 34
@@ -41,9 +41,7 @@ export abstract class VideoSend extends FormReactive implements OnInit {
41 this.firstStepChannelId = this.userVideoChannels[0].id 41 this.firstStepChannelId = this.userVideoChannels[0].id
42 }) 42 })
43 43
44 this.serverConfig = this.serverService.getTmpConfig() 44 this.serverConfig = this.serverService.getHTMLConfig()
45 this.serverService.getConfig()
46 .subscribe(config => this.serverConfig = config)
47 45
48 this.serverService.getVideoPrivacies() 46 this.serverService.getVideoPrivacies()
49 .subscribe( 47 .subscribe(
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts
index d735c936c..8606b8222 100644
--- a/client/src/app/+videos/+video-edit/video-add.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add.component.ts
@@ -1,7 +1,7 @@
1import { Component, HostListener, OnInit, ViewChild } from '@angular/core' 1import { Component, HostListener, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' 3import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core'
4import { ServerConfig } from '@shared/models' 4import { HTMLServerConfig } from '@shared/models'
5import { VideoEditType } from './shared/video-edit.type' 5import { VideoEditType } from './shared/video-edit.type'
6import { VideoGoLiveComponent } from './video-add-components/video-go-live.component' 6import { VideoGoLiveComponent } from './video-add-components/video-go-live.component'
7import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' 7import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component'
@@ -26,7 +26,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate {
26 26
27 activeNav: string 27 activeNav: string
28 28
29 private serverConfig: ServerConfig 29 private serverConfig: HTMLServerConfig
30 30
31 constructor ( 31 constructor (
32 private auth: AuthService, 32 private auth: AuthService,
@@ -42,10 +42,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate {
42 ngOnInit () { 42 ngOnInit () {
43 this.user = this.auth.getUser() 43 this.user = this.auth.getUser()
44 44
45 this.serverConfig = this.serverService.getTmpConfig() 45 this.serverConfig = this.serverService.getHTMLConfig()
46
47 this.serverService.getConfig()
48 .subscribe(config => this.serverConfig = config)
49 46
50 this.user = this.auth.getUser() 47 this.user = this.auth.getUser()
51 48