standard fix
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = class PrefsController {
|
|||||||
const state = this.state
|
const state = this.state
|
||||||
state.location.go({
|
state.location.go({
|
||||||
url: 'preferences',
|
url: 'preferences',
|
||||||
setup(cb) {
|
setup (cb) {
|
||||||
// initialize preferences
|
// initialize preferences
|
||||||
state.window.title = 'Preferences'
|
state.window.title = 'Preferences'
|
||||||
ipcRenderer.send('setAllowNav', false)
|
ipcRenderer.send('setAllowNav', false)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ module.exports = class SubtitlesController {
|
|||||||
if (autoSelect && (i === 0 || isSystemLanguage(track.language))) {
|
if (autoSelect && (i === 0 || isSystemLanguage(track.language))) {
|
||||||
subtitles.selectedIndex = trackIndex
|
subtitles.selectedIndex = trackIndex
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
// Finally, make sure no two tracks have the same label
|
// Finally, make sure no two tracks have the same label
|
||||||
relabelSubtitles(subtitles)
|
relabelSubtitles(subtitles)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ module.exports = class TorrentListController {
|
|||||||
prioritizeTorrent (infoHash) {
|
prioritizeTorrent (infoHash) {
|
||||||
this.state.saved.torrents
|
this.state.saved.torrents
|
||||||
.filter(torrent => // We're interested in active torrents only.
|
.filter(torrent => // We're interested in active torrents only.
|
||||||
['downloading', 'seeding'].indexOf(torrent.status) !== -1)
|
['downloading', 'seeding'].indexOf(torrent.status) !== -1)
|
||||||
.forEach((torrent) => { // Pause all active torrents except the one that started playing.
|
.forEach((torrent) => { // Pause all active torrents except the one that started playing.
|
||||||
if (infoHash === torrent.infoHash) return
|
if (infoHash === torrent.infoHash) return
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ const config = require('../../config')
|
|||||||
const { CastingError } = require('./errors')
|
const { CastingError } = require('./errors')
|
||||||
|
|
||||||
// Lazy load these for a ~300ms improvement in startup time
|
// Lazy load these for a ~300ms improvement in startup time
|
||||||
let airplayer;
|
let airplayer
|
||||||
|
|
||||||
let chromecasts;
|
let chromecasts
|
||||||
let dlnacasts;
|
let dlnacasts
|
||||||
|
|
||||||
// App state. Cast modifies state.playing and state.errors in response to events
|
// App state. Cast modifies state.playing and state.errors in response to events
|
||||||
let state
|
let state
|
||||||
@@ -525,6 +525,6 @@ function setVolume (volume) {
|
|||||||
if (player) player.volume(volume, castCallback)
|
if (player) player.volume(volume, castCallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
function castCallback(...args) {
|
function castCallback (...args) {
|
||||||
console.log('%s callback: %o', state.playing.location, args)
|
console.log('%s callback: %o', state.playing.location, args)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ function migrate_0_7_0 (saved) {
|
|||||||
// * Then, relative paths for the default torrents, eg '../static/sintel.torrent'
|
// * Then, relative paths for the default torrents, eg '../static/sintel.torrent'
|
||||||
// * Then, paths computed at runtime for default torrents, eg 'sintel.torrent'
|
// * Then, paths computed at runtime for default torrents, eg 'sintel.torrent'
|
||||||
// * Finally, now we're getting rid of torrentPath altogether
|
// * Finally, now we're getting rid of torrentPath altogether
|
||||||
let src;
|
let src
|
||||||
|
|
||||||
let dst;
|
let dst
|
||||||
if (ts.torrentPath) {
|
if (ts.torrentPath) {
|
||||||
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
|
||||||
src = ts.torrentPath
|
src = ts.torrentPath
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const State = module.exports = Object.assign(new EventEmitter(), {
|
|||||||
getDefaultPlayState,
|
getDefaultPlayState,
|
||||||
load,
|
load,
|
||||||
// state.save() calls are rate-limited. Use state.saveImmediate() to skip limit.
|
// state.save() calls are rate-limited. Use state.saveImmediate() to skip limit.
|
||||||
save(...args) {
|
save (...args) {
|
||||||
// Perf optimization: Lazy-require debounce (and it's dependencies)
|
// Perf optimization: Lazy-require debounce (and it's dependencies)
|
||||||
const debounce = require('debounce')
|
const debounce = require('debounce')
|
||||||
// After first State.save() invokation, future calls go straight to the
|
// After first State.save() invokation, future calls go straight to the
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function torrentPoster (torrent, cb) {
|
|||||||
type: mediaType,
|
type: mediaType,
|
||||||
size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType])
|
size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType])
|
||||||
})).sort((a, b) => // sort descending on size
|
})).sort((a, b) => // sort descending on size
|
||||||
b.size - a.size)[0]
|
b.size - a.size)[0]
|
||||||
|
|
||||||
if (bestScore.size === 0) {
|
if (bestScore.size === 0) {
|
||||||
// Admit defeat, no video, audio or image had a significant presence
|
// Admit defeat, no video, audio or image had a significant presence
|
||||||
@@ -46,7 +46,7 @@ function calculateDataLengthByExtension (torrent, extensions) {
|
|||||||
if (files.length === 0) return 0
|
if (files.length === 0) return 0
|
||||||
return files
|
return files
|
||||||
.map(file => file.length)
|
.map(file => file.length)
|
||||||
.reduce((a, b) => a + b);
|
.reduce((a, b) => a + b)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +58,7 @@ function calculateDataLengthByExtension (torrent, extensions) {
|
|||||||
function getLargestFileByExtension (torrent, extensions) {
|
function getLargestFileByExtension (torrent, extensions) {
|
||||||
const files = filterOnExtension(torrent, extensions)
|
const files = filterOnExtension(torrent, extensions)
|
||||||
if (files.length === 0) return undefined
|
if (files.length === 0) return undefined
|
||||||
return files.reduce((a, b) => a.length > b.length ? a : b);
|
return files.reduce((a, b) => a.length > b.length ? a : b)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ class CreateTorrentPage extends React.Component {
|
|||||||
|
|
||||||
// Then, use the name of the base folder (or sole file, for a single file torrent)
|
// Then, use the name of the base folder (or sole file, for a single file torrent)
|
||||||
// as the default name. Show all files relative to the base folder.
|
// as the default name. Show all files relative to the base folder.
|
||||||
let defaultName;
|
let defaultName
|
||||||
|
|
||||||
let basePath;
|
let basePath
|
||||||
if (files.length === 1) {
|
if (files.length === 1) {
|
||||||
// Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b'
|
// Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b'
|
||||||
defaultName = files[0].name
|
defaultName = files[0].name
|
||||||
|
|||||||
Reference in New Issue
Block a user