diff --git a/bin/package.js b/bin/package.js index edf00dfd..2db7da46 100755 --- a/bin/package.js +++ b/bin/package.js @@ -198,16 +198,16 @@ function buildDarwin (cb) { infoPlist.CFBundleDocumentTypes = [ { - CFBundleTypeExtensions: [ 'torrent' ], + CFBundleTypeExtensions: ['torrent'], CFBundleTypeIconFile: path.basename(config.APP_FILE_ICON) + '.icns', CFBundleTypeName: 'BitTorrent Document', CFBundleTypeRole: 'Editor', LSHandlerRank: 'Owner', - LSItemContentTypes: [ 'org.bittorrent.torrent' ] + LSItemContentTypes: ['org.bittorrent.torrent'] }, { CFBundleTypeName: 'Any', - CFBundleTypeOSTypes: [ '****' ], + CFBundleTypeOSTypes: ['****'], CFBundleTypeRole: 'Editor', LSHandlerRank: 'Owner', LSTypeIsPackage: false @@ -219,13 +219,13 @@ function buildDarwin (cb) { CFBundleTypeRole: 'Editor', CFBundleURLIconFile: path.basename(config.APP_FILE_ICON) + '.icns', CFBundleURLName: 'BitTorrent Magnet URL', - CFBundleURLSchemes: [ 'magnet' ] + CFBundleURLSchemes: ['magnet'] }, { CFBundleTypeRole: 'Editor', CFBundleURLIconFile: path.basename(config.APP_FILE_ICON) + '.icns', CFBundleURLName: 'BitTorrent Stream-Magnet URL', - CFBundleURLSchemes: [ 'stream-magnet' ] + CFBundleURLSchemes: ['stream-magnet'] } ] @@ -242,7 +242,7 @@ function buildDarwin (cb) { UTTypeReferenceURL: 'http://www.bittorrent.org/beps/bep_0000.html', UTTypeTagSpecification: { 'com.apple.ostype': 'TORR', - 'public.filename-extension': [ 'torrent' ], + 'public.filename-extension': ['torrent'], 'public.mime-type': 'application/x-bittorrent' } } diff --git a/src/main/dialog.js b/src/main/dialog.js index 38b9c96b..c8244599 100644 --- a/src/main/dialog.js +++ b/src/main/dialog.js @@ -19,7 +19,7 @@ function openSeedFile () { log('openSeedFile') const opts = { title: 'Select a file for the torrent.', - properties: [ 'openFile' ] + properties: ['openFile'] } showOpenSeed(opts) } @@ -35,11 +35,11 @@ function openSeedDirectory () { const opts = process.platform === 'darwin' ? { title: 'Select a file or folder for the torrent.', - properties: [ 'openFile', 'openDirectory' ] + properties: ['openFile', 'openDirectory'] } : { title: 'Select a folder for the torrent.', - properties: [ 'openDirectory' ] + properties: ['openDirectory'] } showOpenSeed(opts) } @@ -54,11 +54,11 @@ function openFiles () { const opts = process.platform === 'darwin' ? { title: 'Select a file or folder to add.', - properties: [ 'openFile', 'openDirectory' ] + properties: ['openFile', 'openDirectory'] } : { title: 'Select a file to add.', - properties: [ 'openFile' ] + properties: ['openFile'] } setTitle(opts.title) electron.dialog.showOpenDialog(windows.main.win, opts, function (selectedPaths) { @@ -77,7 +77,7 @@ function openTorrentFile () { const opts = { title: 'Select a .torrent file.', filters: [{ name: 'Torrent Files', extensions: ['torrent'] }], - properties: [ 'openFile', 'multiSelections' ] + properties: ['openFile', 'multiSelections'] } setTitle(opts.title) electron.dialog.showOpenDialog(windows.main.win, opts, function (selectedPaths) { diff --git a/src/main/handlers.js b/src/main/handlers.js index 3c42e443..cdd7a97e 100644 --- a/src/main/handlers.js +++ b/src/main/handlers.js @@ -42,7 +42,7 @@ function installDarwin () { function uninstallDarwin () {} -const EXEC_COMMAND = [ process.execPath, '--' ] +const EXEC_COMMAND = [process.execPath, '--'] if (!config.IS_PRODUCTION) { EXEC_COMMAND.push(config.ROOT_PATH) diff --git a/src/main/index.js b/src/main/index.js index 2b61eeaf..2eece306 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -162,7 +162,7 @@ function onOpen (e, torrentId) { // Electron issue: https://github.com/atom/electron/issues/4338 setTimeout(() => windows.main.show(), 100) - processArgv([ torrentId ]) + processArgv([torrentId]) } else { argv.push(torrentId) } diff --git a/src/main/thumbar.js b/src/main/thumbar.js index fd30d576..f6f936e6 100644 --- a/src/main/thumbar.js +++ b/src/main/thumbar.js @@ -77,8 +77,8 @@ function onPlayerPlay () { function onPlayerUpdate (state) { if (!isEnabled()) return - buttons[PREV].flags = [ state.hasPrevious ? 'enabled' : 'disabled' ] - buttons[NEXT].flags = [ state.hasNext ? 'enabled' : 'disabled' ] + buttons[PREV].flags = [state.hasPrevious ? 'enabled' : 'disabled'] + buttons[NEXT].flags = [state.hasNext ? 'enabled' : 'disabled'] update() } diff --git a/src/renderer/components/path-selector.js b/src/renderer/components/path-selector.js index 6ad66d4b..d6744ffa 100644 --- a/src/renderer/components/path-selector.js +++ b/src/renderer/components/path-selector.js @@ -32,7 +32,7 @@ class PathSelector extends React.Component { handleClick () { const opts = Object.assign({ defaultPath: this.props.value, - properties: [ 'openFile', 'openDirectory' ] + properties: ['openFile', 'openDirectory'] }, this.props.dialog) remote.dialog.showOpenDialog( diff --git a/src/renderer/controllers/subtitles-controller.js b/src/renderer/controllers/subtitles-controller.js index 1ad65ea7..a2302810 100644 --- a/src/renderer/controllers/subtitles-controller.js +++ b/src/renderer/controllers/subtitles-controller.js @@ -15,8 +15,8 @@ module.exports = class SubtitlesController { openSubtitles () { remote.dialog.showOpenDialog({ title: 'Select a subtitles file.', - filters: [ { name: 'Subtitles', extensions: ['vtt', 'srt'] } ], - properties: [ 'openFile' ] + filters: [{ name: 'Subtitles', extensions: ['vtt', 'srt'] }], + properties: ['openFile'] }, (filenames) => { if (!Array.isArray(filenames)) return this.addSubtitles(filenames, true) diff --git a/src/renderer/main.js b/src/renderer/main.js index 498cc23c..d73d517e 100644 --- a/src/renderer/main.js +++ b/src/renderer/main.js @@ -458,7 +458,7 @@ function setDimensions (dimensions) { // Called when the user adds files (.torrent, files to seed, subtitles) to the app // via any method (drag-drop, drag to app icon, command line) function onOpen (files) { - if (!Array.isArray(files)) files = [ files ] + if (!Array.isArray(files)) files = [files] // File API seems to transform "magnet:?foo" in "magnet:///?foo" // this is a sanitization diff --git a/src/renderer/pages/preferences-page.js b/src/renderer/pages/preferences-page.js index 70ce49a0..9bbde8b7 100644 --- a/src/renderer/pages/preferences-page.js +++ b/src/renderer/pages/preferences-page.js @@ -37,7 +37,7 @@ class PreferencesPage extends React.Component {