diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-06 17:13:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-08 09:30:31 +0200 |
commit | ce33919c24e7402d92d81f3cd8e545df52d98240 (patch) | |
tree | 7e131a2f8df649899d0a71294665cf386ffb50d4 /client/src/app/videos/+video-edit/video-add.component.ts | |
parent | 788487140c500abeb69ca44daf3a9e26efa8d36f (diff) | |
download | PeerTube-ce33919c24e7402d92d81f3cd8e545df52d98240.tar.gz PeerTube-ce33919c24e7402d92d81f3cd8e545df52d98240.tar.zst PeerTube-ce33919c24e7402d92d81f3cd8e545df52d98240.zip |
Import magnets with webtorrent
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/video-add.component.ts | 13 |
1 files changed, 10 insertions, 3 deletions
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. | |||
3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' | 3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' |
4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' | 4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' |
5 | import { ServerService } from '@app/core' | 5 | import { ServerService } from '@app/core' |
6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' | ||
6 | 7 | ||
7 | @Component({ | 8 | @Component({ |
8 | selector: 'my-videos-add', | 9 | selector: 'my-videos-add', |
@@ -12,15 +13,16 @@ import { ServerService } from '@app/core' | |||
12 | export class VideoAddComponent implements CanComponentDeactivate { | 13 | export class VideoAddComponent implements CanComponentDeactivate { |
13 | @ViewChild('videoUpload') videoUpload: VideoUploadComponent | 14 | @ViewChild('videoUpload') videoUpload: VideoUploadComponent |
14 | @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent | 15 | @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent |
16 | @ViewChild('videoImportTorrent') videoImportTorrent: VideoImportTorrentComponent | ||
15 | 17 | ||
16 | secondStepType: 'upload' | 'import-url' | 18 | secondStepType: 'upload' | 'import-url' | 'import-torrent' |
17 | videoName: string | 19 | videoName: string |
18 | 20 | ||
19 | constructor ( | 21 | constructor ( |
20 | private serverService: ServerService | 22 | private serverService: ServerService |
21 | ) {} | 23 | ) {} |
22 | 24 | ||
23 | onFirstStepDone (type: 'upload' | 'import-url', videoName: string) { | 25 | onFirstStepDone (type: 'upload' | 'import-url' | 'import-torrent', videoName: string) { |
24 | this.secondStepType = type | 26 | this.secondStepType = type |
25 | this.videoName = videoName | 27 | this.videoName = videoName |
26 | } | 28 | } |
@@ -28,11 +30,16 @@ export class VideoAddComponent implements CanComponentDeactivate { | |||
28 | canDeactivate () { | 30 | canDeactivate () { |
29 | if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() | 31 | if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() |
30 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() | 32 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() |
33 | if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() | ||
31 | 34 | ||
32 | return { canDeactivate: true } | 35 | return { canDeactivate: true } |
33 | } | 36 | } |
34 | 37 | ||
35 | isVideoImportEnabled () { | 38 | isVideoImportHttpEnabled () { |
39 | return this.serverService.getConfig().import.videos.http.enabled | ||
40 | } | ||
41 | |||
42 | isVideoImportTorrentEnabled () { | ||
36 | return this.serverService.getConfig().import.videos.http.enabled | 43 | return this.serverService.getConfig().import.videos.http.enabled |
37 | } | 44 | } |
38 | } | 45 | } |