standard fix

This commit is contained in:
Diego Rodríguez Baquero
2021-10-10 13:51:38 -05:00
parent 63b55df637
commit 08a182d165
8 changed files with 15 additions and 15 deletions

View File

@@ -13,7 +13,7 @@ module.exports = class PrefsController {
const state = this.state
state.location.go({
url: 'preferences',
setup(cb) {
setup (cb) {
// initialize preferences
state.window.title = 'Preferences'
ipcRenderer.send('setAllowNav', false)

View File

@@ -54,7 +54,7 @@ module.exports = class SubtitlesController {
if (autoSelect && (i === 0 || isSystemLanguage(track.language))) {
subtitles.selectedIndex = trackIndex
}
});
})
// Finally, make sure no two tracks have the same label
relabelSubtitles(subtitles)

View File

@@ -157,7 +157,7 @@ module.exports = class TorrentListController {
prioritizeTorrent (infoHash) {
this.state.saved.torrents
.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.
if (infoHash === torrent.infoHash) return

View File

@@ -19,10 +19,10 @@ const config = require('../../config')
const { CastingError } = require('./errors')
// Lazy load these for a ~300ms improvement in startup time
let airplayer;
let airplayer
let chromecasts;
let dlnacasts;
let chromecasts
let dlnacasts
// App state. Cast modifies state.playing and state.errors in response to events
let state
@@ -525,6 +525,6 @@ function setVolume (volume) {
if (player) player.volume(volume, castCallback)
}
function castCallback(...args) {
function castCallback (...args) {
console.log('%s callback: %o', state.playing.location, args)
}

View File

@@ -61,9 +61,9 @@ function migrate_0_7_0 (saved) {
// * Then, relative paths for the default torrents, eg '../static/sintel.torrent'
// * Then, paths computed at runtime for default torrents, eg 'sintel.torrent'
// * Finally, now we're getting rid of torrentPath altogether
let src;
let src
let dst;
let dst
if (ts.torrentPath) {
if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) {
src = ts.torrentPath

View File

@@ -12,7 +12,7 @@ const State = module.exports = Object.assign(new EventEmitter(), {
getDefaultPlayState,
load,
// 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)
const debounce = require('debounce')
// After first State.save() invokation, future calls go straight to the

View File

@@ -17,7 +17,7 @@ function torrentPoster (torrent, cb) {
type: mediaType,
size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType])
})).sort((a, b) => // sort descending on size
b.size - a.size)[0]
b.size - a.size)[0]
if (bestScore.size === 0) {
// 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
return files
.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) {
const files = filterOnExtension(torrent, extensions)
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)
}
/**

View File

@@ -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)
// as the default name. Show all files relative to the base folder.
let defaultName;
let defaultName
let basePath;
let basePath
if (files.length === 1) {
// Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b'
defaultName = files[0].name