diff options
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts | 16 |
1 files changed, 6 insertions, 10 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 c369ba2b7..da4996902 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 | |||
@@ -1,3 +1,4 @@ | |||
1 | import { switchMap } from 'rxjs' | ||
1 | import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 2 | import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
3 | import { AuthService, CanComponentDeactivate, HooksService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, CanComponentDeactivate, HooksService, Notifier, ServerService } from '@app/core' |
@@ -87,21 +88,16 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af | |||
87 | this.loadingBar.useRef().start() | 88 | this.loadingBar.useRef().start() |
88 | 89 | ||
89 | this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate) | 90 | this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate) |
91 | .pipe(switchMap(({ video }) => this.videoService.getVideo({ videoId: video.uuid }))) | ||
90 | .subscribe({ | 92 | .subscribe({ |
91 | next: res => { | 93 | next: video => { |
92 | this.loadingBar.useRef().complete() | 94 | this.loadingBar.useRef().complete() |
93 | this.firstStepDone.emit(res.video.name) | 95 | this.firstStepDone.emit(video.name) |
94 | this.isImportingVideo = false | 96 | this.isImportingVideo = false |
95 | this.hasImportedVideo = true | 97 | this.hasImportedVideo = true |
96 | 98 | ||
97 | this.video = new VideoEdit(Object.assign(res.video, { | 99 | this.video = new VideoEdit(video) |
98 | commentsEnabled: videoUpdate.commentsEnabled, | 100 | this.video.patch({ privacy: this.firstStepPrivacyId }) |
99 | downloadEnabled: videoUpdate.downloadEnabled, | ||
100 | privacy: { id: this.firstStepPrivacyId }, | ||
101 | support: null, | ||
102 | thumbnailUrl: null, | ||
103 | previewUrl: null | ||
104 | })) | ||
105 | 101 | ||
106 | hydrateFormFromVideo(this.form, this.video, false) | 102 | hydrateFormFromVideo(this.form, this.video, false) |
107 | }, | 103 | }, |