aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts6
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts6
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-send.ts9
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts6
4 files changed, 14 insertions, 13 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 538a187a8..3a8e6eecc 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -84,11 +84,11 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
84 channelId: this.firstStepChannelId 84 channelId: this.firstStepChannelId
85 } 85 }
86 86
87 this.loadingBar.start() 87 this.loadingBar.useRef().start()
88 88
89 this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe( 89 this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe(
90 res => { 90 res => {
91 this.loadingBar.complete() 91 this.loadingBar.useRef().complete()
92 this.firstStepDone.emit(res.video.name) 92 this.firstStepDone.emit(res.video.name)
93 this.isImportingVideo = false 93 this.isImportingVideo = false
94 this.hasImportedVideo = true 94 this.hasImportedVideo = true
@@ -105,7 +105,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
105 }, 105 },
106 106
107 err => { 107 err => {
108 this.loadingBar.complete() 108 this.loadingBar.useRef().complete()
109 this.isImportingVideo = false 109 this.isImportingVideo = false
110 this.firstStepError.emit() 110 this.firstStepError.emit()
111 this.notifier.error(err.message) 111 this.notifier.error(err.message)
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
index 6508eef7e..da25663d7 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -71,7 +71,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
71 channelId: this.firstStepChannelId 71 channelId: this.firstStepChannelId
72 } 72 }
73 73
74 this.loadingBar.start() 74 this.loadingBar.useRef().start()
75 75
76 this.videoImportService 76 this.videoImportService
77 .importVideoUrl(this.targetUrl, videoUpdate) 77 .importVideoUrl(this.targetUrl, videoUpdate)
@@ -86,7 +86,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
86 ) 86 )
87 .subscribe( 87 .subscribe(
88 ({ video, videoCaptions }) => { 88 ({ video, videoCaptions }) => {
89 this.loadingBar.complete() 89 this.loadingBar.useRef().complete()
90 this.firstStepDone.emit(video.name) 90 this.firstStepDone.emit(video.name)
91 this.isImportingVideo = false 91 this.isImportingVideo = false
92 this.hasImportedVideo = true 92 this.hasImportedVideo = true
@@ -115,7 +115,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
115 }, 115 },
116 116
117 err => { 117 err => {
118 this.loadingBar.complete() 118 this.loadingBar.useRef().complete()
119 this.isImportingVideo = false 119 this.isImportingVideo = false
120 this.firstStepError.emit() 120 this.firstStepError.emit()
121 this.notifier.error(err.message) 121 this.notifier.error(err.message)
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 5d11ba7ce..2e658dfae 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
@@ -1,5 +1,5 @@
1import { catchError, switchMap, tap } from 'rxjs/operators' 1import { catchError, switchMap, tap } from 'rxjs/operators'
2import { EventEmitter, OnInit, Directive } from '@angular/core' 2import { Directive, EventEmitter, OnInit } from '@angular/core'
3import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' 3import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core'
4import { populateAsyncUserVideoChannels } from '@app/helpers' 4import { populateAsyncUserVideoChannels } from '@app/helpers'
5import { FormReactive } from '@app/shared/shared-forms' 5import { FormReactive } from '@app/shared/shared-forms'
@@ -8,6 +8,7 @@ import { LoadingBarService } from '@ngx-loading-bar/core'
8import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' 8import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
9 9
10@Directive() 10@Directive()
11// tslint:disable-next-line: directive-class-suffix
11export abstract class VideoSend extends FormReactive implements OnInit { 12export abstract class VideoSend extends FormReactive implements OnInit {
12 userVideoChannels: { id: number, label: string, support: string }[] = [] 13 userVideoChannels: { id: number, label: string, support: string }[] = []
13 videoPrivacies: VideoConstant<VideoPrivacy>[] = [] 14 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
@@ -56,15 +57,15 @@ export abstract class VideoSend extends FormReactive implements OnInit {
56 } 57 }
57 58
58 protected updateVideoAndCaptions (video: VideoEdit) { 59 protected updateVideoAndCaptions (video: VideoEdit) {
59 this.loadingBar.start() 60 this.loadingBar.useRef().start()
60 61
61 return this.videoService.updateVideo(video) 62 return this.videoService.updateVideo(video)
62 .pipe( 63 .pipe(
63 // Then update captions 64 // Then update captions
64 switchMap(() => this.videoCaptionService.updateCaptions(video.id, this.videoCaptions)), 65 switchMap(() => this.videoCaptionService.updateCaptions(video.id, this.videoCaptions)),
65 tap(() => this.loadingBar.complete()), 66 tap(() => this.loadingBar.useRef().complete()),
66 catchError(err => { 67 catchError(err => {
67 this.loadingBar.complete() 68 this.loadingBar.useRef().complete()
68 throw err 69 throw err
69 }) 70 })
70 ) 71 )
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 7bd6eb553..581199d65 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -101,7 +101,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
101 101
102 this.video.patch(this.form.value) 102 this.video.patch(this.form.value)
103 103
104 this.loadingBar.start() 104 this.loadingBar.useRef().start()
105 this.isUpdatingVideo = true 105 this.isUpdatingVideo = true
106 106
107 // Update the video 107 // Update the video
@@ -114,13 +114,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
114 () => { 114 () => {
115 this.updateDone = true 115 this.updateDone = true
116 this.isUpdatingVideo = false 116 this.isUpdatingVideo = false
117 this.loadingBar.complete() 117 this.loadingBar.useRef().complete()
118 this.notifier.success(this.i18n('Video updated.')) 118 this.notifier.success(this.i18n('Video updated.'))
119 this.router.navigate([ '/videos/watch', this.video.uuid ]) 119 this.router.navigate([ '/videos/watch', this.video.uuid ])
120 }, 120 },
121 121
122 err => { 122 err => {
123 this.loadingBar.complete() 123 this.loadingBar.useRef().complete()
124 this.isUpdatingVideo = false 124 this.isUpdatingVideo = false
125 this.notifier.error(err.message) 125 this.notifier.error(err.message)
126 console.error(err) 126 console.error(err)