X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-import-torrent.component.ts;h=4d0b0b08087f7765b927f0a155b5dc31e2fd177e;hb=c9ff8a08a06ef0f30ec4963aebfcc02293ca20c5;hp=74e1e755b827273fd3babc4dd0beb1fe963f6048;hpb=f36da21e40104a50acb00132920b835240cebb38;p=github%2FChocobozzz%2FPeerTube.git 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 74e1e755b..4d0b0b080 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 @@ -25,7 +25,7 @@ import { scrollToTop } from '@app/shared/misc/utils' export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() - @ViewChild('torrentfileInput', { static: false }) torrentfileInput: ElementRef + @ViewChild('torrentfileInput') torrentfileInput: ElementRef magnetUri = '' @@ -72,6 +72,11 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca this.importVideo(torrentfile) } + setTorrentFile (files: FileList) { + this.torrentfileInput.nativeElement.files = files + this.fileChange() + } + importVideo (torrentfile?: Blob) { this.isImportingVideo = true