diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-07 11:05:59 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-07 11:05:59 +0100 |
commit | 00336945ce75c04d603ed7950e18b699a606ac8b (patch) | |
tree | 338df130c5ef12a1d6e40a2d4e47dd71f7a41acd /client | |
parent | 196b7790d60c0b374b45d061b9dcbde3ccb80b3e (diff) | |
download | PeerTube-00336945ce75c04d603ed7950e18b699a606ac8b.tar.gz PeerTube-00336945ce75c04d603ed7950e18b699a606ac8b.tar.zst PeerTube-00336945ce75c04d603ed7950e18b699a606ac8b.zip |
Fix file downloading
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/videos/+video-watch/modal/video-download.component.ts | 5 |
1 files changed, 4 insertions, 1 deletions
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 { | |||
13 | @ViewChild('modal') modal: ModalDirective | 13 | @ViewChild('modal') modal: ModalDirective |
14 | 14 | ||
15 | downloadType: 'direct' | 'torrent' = 'torrent' | 15 | downloadType: 'direct' | 'torrent' = 'torrent' |
16 | resolution = -1 | 16 | resolution: number | string = -1 |
17 | 17 | ||
18 | constructor () { | 18 | constructor () { |
19 | // empty | 19 | // empty |
@@ -32,6 +32,9 @@ export class VideoDownloadComponent implements OnInit { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | download () { | 34 | download () { |
35 | // HTML select send us a string, so convert it to a number | ||
36 | this.resolution = parseInt(this.resolution.toString(), 10) | ||
37 | |||
35 | const file = this.video.files.find(f => f.resolution === this.resolution) | 38 | const file = this.video.files.find(f => f.resolution === this.resolution) |
36 | if (!file) { | 39 | if (!file) { |
37 | console.error('Could not find file with resolution %d.', this.resolution) | 40 | console.error('Could not find file with resolution %d.', this.resolution) |