From ce33919c24e7402d92d81f3cd8e545df52d98240 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Aug 2018 17:13:39 +0200 Subject: Import magnets with webtorrent --- client/src/app/videos/+video-edit/video-add.component.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'client/src/app/videos/+video-edit/video-add.component.ts') 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 e74fa1f15..7d360598d 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -3,6 +3,7 @@ import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard. import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' import { ServerService } from '@app/core' +import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' @Component({ selector: 'my-videos-add', @@ -12,15 +13,16 @@ import { ServerService } from '@app/core' export class VideoAddComponent implements CanComponentDeactivate { @ViewChild('videoUpload') videoUpload: VideoUploadComponent @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent + @ViewChild('videoImportTorrent') videoImportTorrent: VideoImportTorrentComponent - secondStepType: 'upload' | 'import-url' + secondStepType: 'upload' | 'import-url' | 'import-torrent' videoName: string constructor ( private serverService: ServerService ) {} - onFirstStepDone (type: 'upload' | 'import-url', videoName: string) { + onFirstStepDone (type: 'upload' | 'import-url' | 'import-torrent', videoName: string) { this.secondStepType = type this.videoName = videoName } @@ -28,11 +30,16 @@ export class VideoAddComponent implements CanComponentDeactivate { canDeactivate () { if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() + if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() return { canDeactivate: true } } - isVideoImportEnabled () { + isVideoImportHttpEnabled () { + return this.serverService.getConfig().import.videos.http.enabled + } + + isVideoImportTorrentEnabled () { return this.serverService.getConfig().import.videos.http.enabled } } -- cgit v1.2.3