diff options
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.ts | 63 |
1 files changed, 32 insertions, 31 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 1534eee82..95336dc75 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts | |||
@@ -47,34 +47,35 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
47 | 47 | ||
48 | this.route.data | 48 | this.route.data |
49 | .pipe(map(data => data.videoData)) | 49 | .pipe(map(data => data.videoData)) |
50 | .subscribe(({ video, videoChannels, videoCaptions, liveVideo }) => { | 50 | .subscribe({ |
51 | this.video = new VideoEdit(video) | 51 | next: ({ video, videoChannels, videoCaptions, liveVideo }) => { |
52 | this.videoDetails = video | 52 | this.video = new VideoEdit(video) |
53 | 53 | this.videoDetails = video | |
54 | this.userVideoChannels = videoChannels | 54 | |
55 | this.videoCaptions = videoCaptions | 55 | this.userVideoChannels = videoChannels |
56 | this.liveVideo = liveVideo | 56 | this.videoCaptions = videoCaptions |
57 | 57 | this.liveVideo = liveVideo | |
58 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE | 58 | |
59 | 59 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE | |
60 | // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout | 60 | |
61 | setTimeout(() => { | 61 | // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout |
62 | hydrateFormFromVideo(this.form, this.video, true) | 62 | setTimeout(() => { |
63 | 63 | hydrateFormFromVideo(this.form, this.video, true) | |
64 | if (this.liveVideo) { | 64 | |
65 | this.form.patchValue({ | 65 | if (this.liveVideo) { |
66 | saveReplay: this.liveVideo.saveReplay, | 66 | this.form.patchValue({ |
67 | permanentLive: this.liveVideo.permanentLive | 67 | saveReplay: this.liveVideo.saveReplay, |
68 | }) | 68 | permanentLive: this.liveVideo.permanentLive |
69 | } | 69 | }) |
70 | }) | 70 | } |
71 | }, | 71 | }) |
72 | }, | ||
72 | 73 | ||
73 | err => { | 74 | error: err => { |
74 | console.error(err) | 75 | console.error(err) |
75 | this.notifier.error(err.message) | 76 | this.notifier.error(err.message) |
76 | } | 77 | } |
77 | ) | 78 | }) |
78 | } | 79 | } |
79 | 80 | ||
80 | @HostListener('window:beforeunload', [ '$event' ]) | 81 | @HostListener('window:beforeunload', [ '$event' ]) |
@@ -150,8 +151,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
150 | return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate) | 151 | return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate) |
151 | }) | 152 | }) |
152 | ) | 153 | ) |
153 | .subscribe( | 154 | .subscribe({ |
154 | () => { | 155 | next: () => { |
155 | this.updateDone = true | 156 | this.updateDone = true |
156 | this.isUpdatingVideo = false | 157 | this.isUpdatingVideo = false |
157 | this.loadingBar.useRef().complete() | 158 | this.loadingBar.useRef().complete() |
@@ -159,13 +160,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
159 | this.router.navigateByUrl(Video.buildWatchUrl(this.video)) | 160 | this.router.navigateByUrl(Video.buildWatchUrl(this.video)) |
160 | }, | 161 | }, |
161 | 162 | ||
162 | err => { | 163 | error: err => { |
163 | this.loadingBar.useRef().complete() | 164 | this.loadingBar.useRef().complete() |
164 | this.isUpdatingVideo = false | 165 | this.isUpdatingVideo = false |
165 | this.notifier.error(err.message) | 166 | this.notifier.error(err.message) |
166 | console.error(err) | 167 | console.error(err) |
167 | } | 168 | } |
168 | ) | 169 | }) |
169 | } | 170 | } |
170 | 171 | ||
171 | hydratePluginFieldsFromVideo () { | 172 | hydratePluginFieldsFromVideo () { |