External player clean up (#914)

* minor `addSubtitles` clean up

* external player clean up
This commit is contained in:
Mathias Rasmussen
2016-09-13 02:46:48 +02:00
committed by DC
parent 3edf21f457
commit 3a4906079b
6 changed files with 34 additions and 36 deletions

View File

@@ -68,7 +68,8 @@ function getDefaultState () {
* Getters, for convenience
*/
getPlayingTorrentSummary,
getPlayingFileSummary
getPlayingFileSummary,
getExternalPlayerName
}
}
@@ -168,6 +169,12 @@ function getPlayingFileSummary () {
return torrentSummary.files[this.playing.fileIndex]
}
function getExternalPlayerName () {
const playerPath = this.saved.prefs.externalPlayerPath
if (!playerPath) return 'VLC'
return path.basename(playerPath).split('.')[0]
}
function load (cb) {
const state = getDefaultState()