aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/video-update.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-26 10:56:55 +0100
committerChocobozzz <me@florianbigard.com>2021-01-26 10:56:55 +0100
commitddb62a85c5517d3437feb7d487a8a11881b68fcb (patch)
treeb27bc798a85224a2fe5406ef5a9be49d17b48d66 /client/src/app/+videos/+video-edit/video-update.component.ts
parente08ff02a9f1fb1cfbdfa8f0f602eda9419ba6cc3 (diff)
downloadPeerTube-ddb62a85c5517d3437feb7d487a8a11881b68fcb.tar.gz
PeerTube-ddb62a85c5517d3437feb7d487a8a11881b68fcb.tar.zst
PeerTube-ddb62a85c5517d3437feb7d487a8a11881b68fcb.zip
Fix wait transcoding checkbox display
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-update.component.ts')
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts
index 30c82343b..e2331c148 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -17,6 +17,7 @@ import { hydrateFormFromVideo } from './shared/video-edit-utils'
17}) 17})
18export class VideoUpdateComponent extends FormReactive implements OnInit { 18export class VideoUpdateComponent extends FormReactive implements OnInit {
19 video: VideoEdit 19 video: VideoEdit
20 videoDetails: VideoDetails
20 userVideoChannels: SelectChannelItem[] = [] 21 userVideoChannels: SelectChannelItem[] = []
21 videoCaptions: VideoCaptionEdit[] = [] 22 videoCaptions: VideoCaptionEdit[] = []
22 liveVideo: LiveVideo 23 liveVideo: LiveVideo
@@ -47,17 +48,14 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
47 .pipe(map(data => data.videoData)) 48 .pipe(map(data => data.videoData))
48 .subscribe(({ video, videoChannels, videoCaptions, liveVideo }) => { 49 .subscribe(({ video, videoChannels, videoCaptions, liveVideo }) => {
49 this.video = new VideoEdit(video) 50 this.video = new VideoEdit(video)
51 this.videoDetails = video
52
50 this.userVideoChannels = videoChannels 53 this.userVideoChannels = videoChannels
51 this.videoCaptions = videoCaptions 54 this.videoCaptions = videoCaptions
52 this.liveVideo = liveVideo 55 this.liveVideo = liveVideo
53 56
54 this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE 57 this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
55 58
56 const videoFiles = (video as VideoDetails).getFiles()
57 if (videoFiles.length > 1) { // Already transcoded
58 this.waitTranscodingEnabled = false
59 }
60
61 // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout 59 // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout
62 setTimeout(() => { 60 setTimeout(() => {
63 hydrateFormFromVideo(this.form, this.video, true) 61 hydrateFormFromVideo(this.form, this.video, true)
@@ -106,6 +104,18 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
106 return this.form.valid 104 return this.form.valid
107 } 105 }
108 106
107 isWaitTranscodingEnabled () {
108 if (this.videoDetails.getFiles().length > 1) { // Already transcoded
109 return false
110 }
111
112 if (this.liveVideo && this.form.value['saveReplay'] !== true) {
113 return false
114 }
115
116 return true
117 }
118
109 update () { 119 update () {
110 if (this.checkForm() === false 120 if (this.checkForm() === false
111 || this.isUpdatingVideo === true) { 121 || this.isUpdatingVideo === true) {