From 00336945ce75c04d603ed7950e18b699a606ac8b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Feb 2018 11:05:59 +0100 Subject: [PATCH] Fix file downloading --- .../videos/+video-watch/modal/video-download.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.41.0