]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/modal/video-download.component.ts
Fix file downloading
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-download.component.ts
index 1a73ea6df0de8796e62ad23f4935db614c1bee1c..3b409e2e6656c700f6eeab5024e3f1b514e21070 100644 (file)
@@ -13,7 +13,7 @@ export class VideoDownloadComponent implements OnInit {
   @ViewChild('modal') modal: ModalDirective
 
   downloadType: 'direct' | 'torrent' = 'torrent'
-  resolution = -1
+  resolution: number | string = -1
 
   constructor () {
     // empty
@@ -32,6 +32,9 @@ export class VideoDownloadComponent implements OnInit {
   }
 
   download () {
+    // HTML select send us a string, so convert it to a number
+    this.resolution = parseInt(this.resolution.toString(), 10)
+
     const file = this.video.files.find(f => f.resolution === this.resolution)
     if (!file) {
       console.error('Could not find file with resolution %d.', this.resolution)