From: Chocobozzz Date: Wed, 7 Feb 2018 10:05:59 +0000 (+0100) Subject: Fix file downloading X-Git-Tag: v0.0.21-alpha~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=00336945ce75c04d603ed7950e18b699a606ac8b;p=github%2FChocobozzz%2FPeerTube.git Fix file downloading --- diff --git a/client/src/app/videos/+video-watch/modal/video-download.component.ts b/client/src/app/videos/+video-watch/modal/video-download.component.ts index 1a73ea6df..3b409e2e6 100644 --- a/client/src/app/videos/+video-watch/modal/video-download.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-download.component.ts @@ -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)