diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index 459ee6df..158841a5 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -156,8 +156,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) + .filter(torrent => ['downloading', 'seeding'].includes(torrent.status)) // Active torrents only. .forEach((torrent) => { // Pause all active torrents except the one that started playing. if (infoHash === torrent.infoHash) return diff --git a/src/renderer/lib/cast.js b/src/renderer/lib/cast.js index 6daf9923..27cb251f 100644 --- a/src/renderer/lib/cast.js +++ b/src/renderer/lib/cast.js @@ -19,10 +19,7 @@ const config = require('../../config') const { CastingError } = require('./errors') // Lazy load these for a ~300ms improvement in startup time -let airplayer - -let chromecasts -let dlnacasts +let airplayer, chromecasts, dlnacasts // App state. Cast modifies state.playing and state.errors in response to events let state diff --git a/src/renderer/lib/migrations.js b/src/renderer/lib/migrations.js index c7fbefcd..a144028b 100644 --- a/src/renderer/lib/migrations.js +++ b/src/renderer/lib/migrations.js @@ -61,9 +61,7 @@ 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 dst + let src, dst if (ts.torrentPath) { if (path.isAbsolute(ts.torrentPath) || ts.torrentPath.startsWith('..')) { src = ts.torrentPath diff --git a/src/renderer/lib/torrent-poster.js b/src/renderer/lib/torrent-poster.js index 5c247bf9..da33cd27 100644 --- a/src/renderer/lib/torrent-poster.js +++ b/src/renderer/lib/torrent-poster.js @@ -16,8 +16,7 @@ function torrentPoster (torrent, cb) { const bestScore = ['audio', 'video', 'image'].map(mediaType => ({ type: mediaType, size: calculateDataLengthByExtension(torrent, mediaExtensions[mediaType]) - })).sort((a, b) => // sort descending on size - b.size - a.size)[0] + })).sort((a, b) => b.size - a.size)[0] // sort descending on size if (bestScore.size === 0) { // Admit defeat, no video, audio or image had a significant presence diff --git a/src/renderer/pages/create-torrent-page.js b/src/renderer/pages/create-torrent-page.js index a54d3df7..5041268d 100644 --- a/src/renderer/pages/create-torrent-page.js +++ b/src/renderer/pages/create-torrent-page.js @@ -40,9 +40,7 @@ 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 basePath + let defaultName, basePath if (files.length === 1) { // Single file torrent: /a/b/foo.jpg -> torrent name 'foo.jpg', path '/a/b' defaultName = files[0].name