using icon as checkbox

This commit is contained in:
Alberto Miranda
2016-07-29 22:07:44 -03:00
parent 9f66418073
commit 91e61f6cd4
3 changed files with 36 additions and 31 deletions

View File

@@ -196,13 +196,8 @@ module.exports = class PlaybackController {
}
}
function getOpenInVlc () {
return this.state.saved.prefs.playInVlc
}
openPlayerFromActiveTorrent (torrentSummary, index, timeout, cb) {
var fileSummary = torrentSummary.files[index]
}
// update state
var state = this.state
@@ -246,6 +241,14 @@ function getOpenInVlc () {
return this.update()
}
// play in VLC if set as default player (Preferences / Playback / Play in VLC)
if (this.state.saved.prefs.playInVlc) {
dispatch('vlcPlay')
this.update()
cb()
return
}
// otherwise, play the video
dispatch('setTitle', torrentSummary.files[state.playing.fileIndex].name)
this.update()
@@ -255,14 +258,6 @@ function getOpenInVlc () {
})
}
// play in VLC if set as default player (Preferences / Playback / Play in VLC)
if (getOpenInVlc()) {
dispatch('vlcPlay')
this.update()
cb()
return
}
closePlayer () {
console.log('closePlayer')