Merge pull request #1806 from LinusU/object-shorthand
This commit is contained in:
@@ -430,7 +430,7 @@ function buildWin32 (cb) {
|
|||||||
// remoteToken: process.env.WEBTORRENT_GITHUB_API_TOKEN,
|
// remoteToken: process.env.WEBTORRENT_GITHUB_API_TOKEN,
|
||||||
setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
|
setupExe: config.APP_NAME + 'Setup-v' + config.APP_VERSION + '.exe',
|
||||||
setupIcon: config.APP_ICON + '.ico',
|
setupIcon: config.APP_ICON + '.ico',
|
||||||
signWithParams: signWithParams,
|
signWithParams,
|
||||||
title: config.APP_NAME,
|
title: config.APP_NAME,
|
||||||
usePackageJson: false,
|
usePackageJson: false,
|
||||||
version: pkg.version
|
version: pkg.version
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ module.exports = {
|
|||||||
APP_COPYRIGHT: `Copyright © 2014-${new Date().getFullYear()} ${APP_TEAM}`,
|
APP_COPYRIGHT: `Copyright © 2014-${new Date().getFullYear()} ${APP_TEAM}`,
|
||||||
APP_FILE_ICON: path.join(__dirname, '..', 'static', 'WebTorrentFile'),
|
APP_FILE_ICON: path.join(__dirname, '..', 'static', 'WebTorrentFile'),
|
||||||
APP_ICON: path.join(__dirname, '..', 'static', 'WebTorrent'),
|
APP_ICON: path.join(__dirname, '..', 'static', 'WebTorrent'),
|
||||||
APP_NAME: APP_NAME,
|
APP_NAME,
|
||||||
APP_TEAM: APP_TEAM,
|
APP_TEAM,
|
||||||
APP_VERSION: APP_VERSION,
|
APP_VERSION,
|
||||||
APP_WINDOW_TITLE: APP_NAME,
|
APP_WINDOW_TITLE: APP_NAME,
|
||||||
|
|
||||||
CONFIG_PATH: getConfigPath(),
|
CONFIG_PATH: getConfigPath(),
|
||||||
@@ -78,9 +78,9 @@ module.exports = {
|
|||||||
HOME_PAGE_URL: 'https://webtorrent.io',
|
HOME_PAGE_URL: 'https://webtorrent.io',
|
||||||
TWITTER_PAGE_URL: 'https://twitter.com/WebTorrentApp',
|
TWITTER_PAGE_URL: 'https://twitter.com/WebTorrentApp',
|
||||||
|
|
||||||
IS_PORTABLE: IS_PORTABLE,
|
IS_PORTABLE,
|
||||||
IS_PRODUCTION: IS_PRODUCTION,
|
IS_PRODUCTION,
|
||||||
IS_TEST: IS_TEST,
|
IS_TEST,
|
||||||
|
|
||||||
OS_SYSARCH: arch() === 'x64' ? 'x64' : 'ia32',
|
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_HEIGHT: UI_HEADER_HEIGHT + (UI_TORRENT_HEIGHT * 2), // header + 2 torrents
|
||||||
WINDOW_MIN_WIDTH: 425,
|
WINDOW_MIN_WIDTH: 425,
|
||||||
|
|
||||||
UI_HEADER_HEIGHT: UI_HEADER_HEIGHT,
|
UI_HEADER_HEIGHT,
|
||||||
UI_TORRENT_HEIGHT: UI_TORRENT_HEIGHT
|
UI_TORRENT_HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfigPath () {
|
function getConfigPath () {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ function init () {
|
|||||||
isReady = true
|
isReady = true
|
||||||
const state = results.state
|
const state = results.state
|
||||||
|
|
||||||
windows.main.init(state, { hidden: hidden })
|
windows.main.init(state, { hidden })
|
||||||
windows.webtorrent.init()
|
windows.webtorrent.init()
|
||||||
menu.init()
|
menu.init()
|
||||||
|
|
||||||
|
|||||||
@@ -235,8 +235,8 @@ function init () {
|
|||||||
} else {
|
} else {
|
||||||
// Queue message for webtorrent window, it hasn't finished loading yet
|
// Queue message for webtorrent window, it hasn't finished loading yet
|
||||||
messageQueueMainToWebTorrent.push({
|
messageQueueMainToWebTorrent.push({
|
||||||
name: name,
|
name,
|
||||||
args: args
|
args
|
||||||
})
|
})
|
||||||
log('webtorrent: queueing %s', name)
|
log('webtorrent: queueing %s', name)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module.exports = class MediaController {
|
|||||||
ipcRenderer.once('checkForExternalPlayer', function (e, isInstalled) {
|
ipcRenderer.once('checkForExternalPlayer', function (e, isInstalled) {
|
||||||
state.modal = {
|
state.modal = {
|
||||||
id: 'unsupported-media-modal',
|
id: 'unsupported-media-modal',
|
||||||
error: error,
|
error,
|
||||||
externalPlayerInstalled: isInstalled
|
externalPlayerInstalled: isInstalled
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ function loadSubtitle (file, cb) {
|
|||||||
buffer: 'data:text/vtt;base64,' + buf.toString('base64'),
|
buffer: 'data:text/vtt;base64,' + buf.toString('base64'),
|
||||||
language: langDetected,
|
language: langDetected,
|
||||||
label: langDetected,
|
label: langDetected,
|
||||||
filePath: filePath
|
filePath
|
||||||
}
|
}
|
||||||
|
|
||||||
cb(null, track)
|
cb(null, track)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ module.exports = class TorrentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
torrentSummary = {
|
torrentSummary = {
|
||||||
torrentKey: torrentKey,
|
torrentKey,
|
||||||
status: 'new'
|
status: 'new'
|
||||||
}
|
}
|
||||||
torrents.unshift(torrentSummary)
|
torrents.unshift(torrentSummary)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ module.exports = class TorrentListController {
|
|||||||
if (files.length === 0 || typeof files[0] !== 'string') {
|
if (files.length === 0 || typeof files[0] !== 'string') {
|
||||||
this.state.location.go({
|
this.state.location.go({
|
||||||
url: 'create-torrent',
|
url: 'create-torrent',
|
||||||
files: files,
|
files,
|
||||||
setup: (cb) => {
|
setup: (cb) => {
|
||||||
this.state.window.title = 'Create New Torrent'
|
this.state.window.title = 'Create New Torrent'
|
||||||
cb(null)
|
cb(null)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module.exports = class UpdateController {
|
|||||||
console.log('new version skipped by user: v' + version)
|
console.log('new version skipped by user: v' + version)
|
||||||
return
|
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
|
// Don't show the modal again until the next version
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ function torrentPosterFromAudio (torrent, cb) {
|
|||||||
|
|
||||||
const bestCover = imageFiles.map(file => {
|
const bestCover = imageFiles.map(file => {
|
||||||
return {
|
return {
|
||||||
file: file,
|
file,
|
||||||
score: scoreAudioCoverFile(file)
|
score: scoreAudioCoverFile(file)
|
||||||
}
|
}
|
||||||
}).reduce((a, b) => {
|
}).reduce((a, b) => {
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ const dispatchHandlers = {
|
|||||||
// Preferences screen
|
// Preferences screen
|
||||||
preferences: () => controllers.prefs().show(),
|
preferences: () => controllers.prefs().show(),
|
||||||
updatePreferences: (key, value) => controllers.prefs().update(key, value),
|
updatePreferences: (key, value) => controllers.prefs().update(key, value),
|
||||||
checkDownloadPath: checkDownloadPath,
|
checkDownloadPath,
|
||||||
startFolderWatcher: () => controllers.folderWatcher().start(),
|
startFolderWatcher: () => controllers.folderWatcher().start(),
|
||||||
stopFolderWatcher: () => controllers.folderWatcher().stop(),
|
stopFolderWatcher: () => controllers.folderWatcher().stop(),
|
||||||
|
|
||||||
@@ -322,20 +322,20 @@ const dispatchHandlers = {
|
|||||||
|
|
||||||
// Navigation between screens (back, forward, ESC, etc)
|
// Navigation between screens (back, forward, ESC, etc)
|
||||||
exitModal: () => { state.modal = null },
|
exitModal: () => { state.modal = null },
|
||||||
backToList: backToList,
|
backToList,
|
||||||
escapeBack: escapeBack,
|
escapeBack,
|
||||||
back: () => state.location.back(),
|
back: () => state.location.back(),
|
||||||
forward: () => state.location.forward(),
|
forward: () => state.location.forward(),
|
||||||
cancel: () => state.location.cancel(),
|
cancel: () => state.location.cancel(),
|
||||||
|
|
||||||
// Controlling the window
|
// Controlling the window
|
||||||
setDimensions: setDimensions,
|
setDimensions,
|
||||||
toggleFullScreen: (setTo) => ipcRenderer.send('toggleFullScreen', setTo),
|
toggleFullScreen: (setTo) => ipcRenderer.send('toggleFullScreen', setTo),
|
||||||
setTitle: (title) => { state.window.title = title },
|
setTitle: (title) => { state.window.title = title },
|
||||||
resetTitle: () => { state.window.title = config.APP_WINDOW_TITLE },
|
resetTitle: () => { state.window.title = config.APP_WINDOW_TITLE },
|
||||||
|
|
||||||
// Everything else
|
// Everything else
|
||||||
onOpen: onOpen,
|
onOpen,
|
||||||
error: onError,
|
error: onError,
|
||||||
uncaughtError: (proc, err) => telemetry.logUncaughtError(proc, err),
|
uncaughtError: (proc, err) => telemetry.logUncaughtError(proc, err),
|
||||||
stateSave: () => State.save(state),
|
stateSave: () => State.save(state),
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ function startTorrenting (torrentKey, torrentID, path, fileModtimes, selections)
|
|||||||
console.log('starting torrent %s: %s', torrentKey, torrentID)
|
console.log('starting torrent %s: %s', torrentKey, torrentID)
|
||||||
|
|
||||||
const torrent = client.add(torrentID, {
|
const torrent = client.add(torrentID, {
|
||||||
path: path,
|
path,
|
||||||
fileModtimes: fileModtimes
|
fileModtimes
|
||||||
})
|
})
|
||||||
torrent.key = torrentKey
|
torrent.key = torrentKey
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user