@ViewChild('modal') modal: ModalDirective
downloadType: 'direct' | 'torrent' = 'torrent'
- resolution = -1
+ resolutionId: number | string = -1
constructor () {
// empty
}
ngOnInit () {
- this.resolution = this.video.files[0].resolution
+ this.resolutionId = this.video.files[0].resolution.id
}
show () {
}
download () {
- const file = this.video.files.find(f => f.resolution === this.resolution)
+ // HTML select send us a string, so convert it to a number
+ this.resolutionId = parseInt(this.resolutionId.toString(), 10)
+
+ const file = this.video.files.find(f => f.resolution.id === this.resolutionId)
if (!file) {
- console.error('Could not find file with resolution %d.', this.resolution)
+ console.error('Could not find file with resolution %d.', this.resolutionId)
return
}