Merge pull request #795 from feross/small-fixes

A bunch of small fixes
This commit is contained in:
Feross Aboukhadijeh
2016-08-22 02:04:19 +02:00
committed by GitHub
5 changed files with 9 additions and 12 deletions

View File

@@ -241,6 +241,8 @@ module.exports = class PlaybackController {
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)
if (this.state.saved.prefs.openExternalPlayer) {
dispatch('openExternalPlayer')
@@ -250,7 +252,6 @@ module.exports = class PlaybackController {
}
// otherwise, play the video
state.window.title = torrentSummary.files[state.playing.fileIndex].name
this.update()
ipcRenderer.send('onPlayerOpen')

View File

@@ -3,6 +3,8 @@ const fs = require('fs-extra')
const path = require('path')
const parallel = require('run-parallel')
const remote = electron.remote
const {dispatch} = require('../lib/dispatcher')
module.exports = class SubtitlesController {
@@ -11,7 +13,7 @@ module.exports = class SubtitlesController {
}
openSubtitles () {
electron.remote.dialog.showOpenDialog({
remote.dialog.showOpenDialog({
title: 'Select a subtitles file.',
filters: [ { name: 'Subtitles', extensions: ['vtt', 'srt'] } ],
properties: [ 'openFile' ]

View File

@@ -38,8 +38,6 @@ function run (state) {
}
function migrate_0_7_0 (saved) {
console.log('migrate to 0.7.0')
var fs = require('fs-extra')
var path = require('path')
@@ -54,7 +52,6 @@ function migrate_0_7_0 (saved) {
// * Finally, now we're getting rid of torrentPath altogether
var src, dst
if (ts.torrentPath) {
console.log('replacing torrentPath %s', ts.torrentPath)
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
src = ts.torrentPath
} else {
@@ -71,7 +68,6 @@ function migrate_0_7_0 (saved) {
// Replace posterURL with posterFileName
if (ts.posterURL) {
console.log('replacing posterURL %s', ts.posterURL)
var extension = path.extname(ts.posterURL)
src = path.isAbsolute(ts.posterURL)
? ts.posterURL
@@ -95,7 +91,7 @@ function migrate_0_7_0 (saved) {
}
function migrate_0_7_2 (saved) {
if (!saved.prefs) {
if (saved.prefs == null) {
saved.prefs = {
downloadPath: config.DEFAULT_DOWNLOAD_PATH
}
@@ -103,7 +99,7 @@ function migrate_0_7_2 (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
saved.prefs.isFileHandler = true
}

View File

@@ -118,8 +118,6 @@ function getApproxNumTorrents (state) {
// An uncaught error happened in the main process or in one of the windows
function logUncaughtError (procName, err) {
console.error('uncaught error', procName, err)
// Not initialized yet? Ignore.
// Hopefully uncaught errors immediately on startup are fixed in dev
if (!telemetry) return