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

@@ -1,6 +1,5 @@
const React = require('react')
const electron = require('electron')
const path = require('path')
const ModalOKCancel = require('./modal-ok-cancel')
const {dispatcher} = require('../lib/dispatcher')
@@ -12,15 +11,11 @@ module.exports = class UnsupportedMediaModal extends React.Component {
const message = (err && err.getMessage)
? err.getMessage()
: err
const playerPath = state.saved.prefs.externalPlayerPath
const playerName = playerPath
? path.basename(playerPath).split('.')[0]
: 'VLC'
const onAction = state.modal.externalPlayerInstalled
? dispatcher('openExternalPlayer')
: () => this.onInstall()
const actionText = state.modal.externalPlayerInstalled
? 'PLAY IN ' + playerName.toUpperCase()
? 'PLAY IN ' + state.getExternalPlayerName().toUpperCase()
: 'INSTALL VLC'
const errorMessage = state.modal.externalPlayerNotFound
? 'Couldn\'t run external player. Please make sure it\'s installed.'