@@ -26,7 +26,7 @@ function spawn (path, url, title) {
|
|||||||
// Try to find and use VLC if external player is not specified
|
// Try to find and use VLC if external player is not specified
|
||||||
vlcCommand(function (err, vlcPath) {
|
vlcCommand(function (err, vlcPath) {
|
||||||
if (err) return windows.main.dispatch('externalPlayerNotFound')
|
if (err) return windows.main.dispatch('externalPlayerNotFound')
|
||||||
var args = ['--play-and-exit', '--video-on-top', '--no-video-title-show', '--quiet', `--meta-title=${title}`, url]
|
var args = ['--play-and-exit', '--video-on-top', '--quiet', `--meta-title=${JSON.stringify(title)}`, url]
|
||||||
spawnExternal(vlcPath, args)
|
spawnExternal(vlcPath, args)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ function kill () {
|
|||||||
function spawnExternal (path, args) {
|
function spawnExternal (path, args) {
|
||||||
log('Running external media player:', path + ' ' + args.join(' '))
|
log('Running external media player:', path + ' ' + args.join(' '))
|
||||||
|
|
||||||
proc = cp.spawn(path, args)
|
proc = cp.spawn(path, args, {stdio: 'ignore'})
|
||||||
|
|
||||||
// If it works, close the modal after a second
|
// If it works, close the modal after a second
|
||||||
var closeModalTimeout = setTimeout(() =>
|
var closeModalTimeout = setTimeout(() =>
|
||||||
|
|||||||
@@ -241,6 +241,8 @@ module.exports = class PlaybackController {
|
|||||||
return this.update()
|
return this.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.window.title = torrentSummary.files[state.playing.fileIndex].name
|
||||||
|
|
||||||
// play in VLC if set as default player (Preferences / Playback / Play in VLC)
|
// play in VLC if set as default player (Preferences / Playback / Play in VLC)
|
||||||
if (this.state.saved.prefs.openExternalPlayer) {
|
if (this.state.saved.prefs.openExternalPlayer) {
|
||||||
dispatch('openExternalPlayer')
|
dispatch('openExternalPlayer')
|
||||||
@@ -250,7 +252,6 @@ module.exports = class PlaybackController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, play the video
|
// otherwise, play the video
|
||||||
state.window.title = torrentSummary.files[state.playing.fileIndex].name
|
|
||||||
this.update()
|
this.update()
|
||||||
|
|
||||||
ipcRenderer.send('onPlayerOpen')
|
ipcRenderer.send('onPlayerOpen')
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ const fs = require('fs-extra')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const parallel = require('run-parallel')
|
const parallel = require('run-parallel')
|
||||||
|
|
||||||
|
const remote = electron.remote
|
||||||
|
|
||||||
const {dispatch} = require('../lib/dispatcher')
|
const {dispatch} = require('../lib/dispatcher')
|
||||||
|
|
||||||
module.exports = class SubtitlesController {
|
module.exports = class SubtitlesController {
|
||||||
@@ -11,7 +13,7 @@ module.exports = class SubtitlesController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openSubtitles () {
|
openSubtitles () {
|
||||||
electron.remote.dialog.showOpenDialog({
|
remote.dialog.showOpenDialog({
|
||||||
title: 'Select a subtitles file.',
|
title: 'Select a subtitles file.',
|
||||||
filters: [ { name: 'Subtitles', extensions: ['vtt', 'srt'] } ],
|
filters: [ { name: 'Subtitles', extensions: ['vtt', 'srt'] } ],
|
||||||
properties: [ 'openFile' ]
|
properties: [ 'openFile' ]
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ function run (state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function migrate_0_7_0 (saved) {
|
function migrate_0_7_0 (saved) {
|
||||||
console.log('migrate to 0.7.0')
|
|
||||||
|
|
||||||
var fs = require('fs-extra')
|
var fs = require('fs-extra')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
|
|
||||||
@@ -54,7 +52,6 @@ function migrate_0_7_0 (saved) {
|
|||||||
// * Finally, now we're getting rid of torrentPath altogether
|
// * Finally, now we're getting rid of torrentPath altogether
|
||||||
var src, dst
|
var src, dst
|
||||||
if (ts.torrentPath) {
|
if (ts.torrentPath) {
|
||||||
console.log('replacing torrentPath %s', ts.torrentPath)
|
|
||||||
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
||||||
src = ts.torrentPath
|
src = ts.torrentPath
|
||||||
} else {
|
} else {
|
||||||
@@ -71,7 +68,6 @@ function migrate_0_7_0 (saved) {
|
|||||||
|
|
||||||
// Replace posterURL with posterFileName
|
// Replace posterURL with posterFileName
|
||||||
if (ts.posterURL) {
|
if (ts.posterURL) {
|
||||||
console.log('replacing posterURL %s', ts.posterURL)
|
|
||||||
var extension = path.extname(ts.posterURL)
|
var extension = path.extname(ts.posterURL)
|
||||||
src = path.isAbsolute(ts.posterURL)
|
src = path.isAbsolute(ts.posterURL)
|
||||||
? ts.posterURL
|
? ts.posterURL
|
||||||
@@ -95,7 +91,7 @@ function migrate_0_7_0 (saved) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function migrate_0_7_2 (saved) {
|
function migrate_0_7_2 (saved) {
|
||||||
if (!saved.prefs) {
|
if (saved.prefs == null) {
|
||||||
saved.prefs = {
|
saved.prefs = {
|
||||||
downloadPath: config.DEFAULT_DOWNLOAD_PATH
|
downloadPath: config.DEFAULT_DOWNLOAD_PATH
|
||||||
}
|
}
|
||||||
@@ -103,7 +99,7 @@ function migrate_0_7_2 (saved) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function migrate_0_11_0 (saved) {
|
function migrate_0_11_0 (saved) {
|
||||||
if (saved.prefs.isFileHandler === undefined) {
|
if (saved.prefs.isFileHandler == null) {
|
||||||
// The app used to make itself the default torrent file handler automatically
|
// The app used to make itself the default torrent file handler automatically
|
||||||
saved.prefs.isFileHandler = true
|
saved.prefs.isFileHandler = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ function getApproxNumTorrents (state) {
|
|||||||
|
|
||||||
// An uncaught error happened in the main process or in one of the windows
|
// An uncaught error happened in the main process or in one of the windows
|
||||||
function logUncaughtError (procName, err) {
|
function logUncaughtError (procName, err) {
|
||||||
console.error('uncaught error', procName, err)
|
|
||||||
|
|
||||||
// Not initialized yet? Ignore.
|
// Not initialized yet? Ignore.
|
||||||
// Hopefully uncaught errors immediately on startup are fixed in dev
|
// Hopefully uncaught errors immediately on startup are fixed in dev
|
||||||
if (!telemetry) return
|
if (!telemetry) return
|
||||||
|
|||||||
Reference in New Issue
Block a user