Use object shorthand for properties

This commit is contained in:
Linus Unnebäck
2020-04-26 15:14:36 +01:00
parent cf0cf79440
commit 81b3d64f42
12 changed files with 25 additions and 25 deletions

View File

@@ -430,7 +430,7 @@ function buildWin32 (cb) {
// remoteToken: process.env.WEBTORRENT_GITHUB_API_TOKEN,
setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
setupIcon: config.APP_ICON + '.ico',
signWithParams: signWithParams,
signWithParams,
title: config.APP_NAME,
usePackageJson: false,
version: pkg.version

View File

@@ -26,9 +26,9 @@ module.exports = {
APP_COPYRIGHT: `Copyright © 2014-${new Date().getFullYear()} ${APP_TEAM}`,
APP_FILE_ICON: path.join(__dirname, '..', 'static', 'WebTorrentFile'),
APP_ICON: path.join(__dirname, '..', 'static', 'WebTorrent'),
APP_NAME: APP_NAME,
APP_TEAM: APP_TEAM,
APP_VERSION: APP_VERSION,
APP_NAME,
APP_TEAM,
APP_VERSION,
APP_WINDOW_TITLE: APP_NAME,
CONFIG_PATH: getConfigPath(),
@@ -78,9 +78,9 @@ module.exports = {
HOME_PAGE_URL: 'https://webtorrent.io',
TWITTER_PAGE_URL: 'https://twitter.com/WebTorrentApp',
IS_PORTABLE: IS_PORTABLE,
IS_PRODUCTION: IS_PRODUCTION,
IS_TEST: IS_TEST,
IS_PORTABLE,
IS_PRODUCTION,
IS_TEST,
OS_SYSARCH: arch() === 'x64' ? 'x64' : 'ia32',
@@ -100,8 +100,8 @@ module.exports = {
WINDOW_MIN_HEIGHT: UI_HEADER_HEIGHT + (UI_TORRENT_HEIGHT * 2), // header + 2 torrents
WINDOW_MIN_WIDTH: 425,
UI_HEADER_HEIGHT: UI_HEADER_HEIGHT,
UI_TORRENT_HEIGHT: UI_TORRENT_HEIGHT
UI_HEADER_HEIGHT,
UI_TORRENT_HEIGHT
}
function getConfigPath () {

View File

@@ -81,7 +81,7 @@ function init () {
isReady = true
const state = results.state
windows.main.init(state, { hidden: hidden })
windows.main.init(state, { hidden })
windows.webtorrent.init()
menu.init()

View File

@@ -235,8 +235,8 @@ function init () {
} else {
// Queue message for webtorrent window, it hasn't finished loading yet
messageQueueMainToWebTorrent.push({
name: name,
args: args
name,
args
})
log('webtorrent: queueing %s', name)
}

View File

@@ -26,7 +26,7 @@ module.exports = class MediaController {
ipcRenderer.once('checkForExternalPlayer', function (e, isInstalled) {
state.modal = {
id: 'unsupported-media-modal',
error: error,
error,
externalPlayerInstalled: isInstalled
}
})

View File

@@ -109,7 +109,7 @@ function loadSubtitle (file, cb) {
buffer: 'data:text/vtt;base64,' + buf.toString('base64'),
language: langDetected,
label: langDetected,
filePath: filePath
filePath
}
cb(null, track)

View File

@@ -25,7 +25,7 @@ module.exports = class TorrentController {
}
torrentSummary = {
torrentKey: torrentKey,
torrentKey,
status: 'new'
}
torrents.unshift(torrentSummary)

View File

@@ -55,7 +55,7 @@ module.exports = class TorrentListController {
if (files.length === 0 || typeof files[0] !== 'string') {
this.state.location.go({
url: 'create-torrent',
files: files,
files,
setup: (cb) => {
this.state.window.title = 'Create New Torrent'
cb(null)

View File

@@ -13,7 +13,7 @@ module.exports = class UpdateController {
console.log('new version skipped by user: v' + version)
return
}
this.state.modal = { id: 'update-available-modal', version: version }
this.state.modal = { id: 'update-available-modal', version }
}
// Don't show the modal again until the next version

View File

@@ -117,7 +117,7 @@ function torrentPosterFromAudio (torrent, cb) {
const bestCover = imageFiles.map(file => {
return {
file: file,
file,
score: scoreAudioCoverFile(file)
}
}).reduce((a, b) => {

View File

@@ -312,7 +312,7 @@ const dispatchHandlers = {
// Preferences screen
preferences: () => controllers.prefs().show(),
updatePreferences: (key, value) => controllers.prefs().update(key, value),
checkDownloadPath: checkDownloadPath,
checkDownloadPath,
startFolderWatcher: () => controllers.folderWatcher().start(),
stopFolderWatcher: () => controllers.folderWatcher().stop(),
@@ -322,20 +322,20 @@ const dispatchHandlers = {
// Navigation between screens (back, forward, ESC, etc)
exitModal: () => { state.modal = null },
backToList: backToList,
escapeBack: escapeBack,
backToList,
escapeBack,
back: () => state.location.back(),
forward: () => state.location.forward(),
cancel: () => state.location.cancel(),
// Controlling the window
setDimensions: setDimensions,
setDimensions,
toggleFullScreen: (setTo) => ipcRenderer.send('toggleFullScreen', setTo),
setTitle: (title) => { state.window.title = title },
resetTitle: () => { state.window.title = config.APP_WINDOW_TITLE },
// Everything else
onOpen: onOpen,
onOpen,
error: onError,
uncaughtError: (proc, err) => telemetry.logUncaughtError(proc, err),
stateSave: () => State.save(state),

View File

@@ -113,8 +113,8 @@ function startTorrenting (torrentKey, torrentID, path, fileModtimes, selections)
console.log('starting torrent %s: %s', torrentKey, torrentID)
const torrent = client.add(torrentID, {
path: path,
fileModtimes: fileModtimes
path,
fileModtimes
})
torrent.key = torrentKey