Used string template where it made sense.
This commit is contained in:
@@ -7,7 +7,8 @@ const electron = require('electron')
|
|||||||
const config = require('../config')
|
const config = require('../config')
|
||||||
const log = require('./log')
|
const log = require('./log')
|
||||||
|
|
||||||
const ANNOUNCEMENT_URL = `${config.ANNOUNCEMENT_URL}?version=${config.APP_VERSION}&platform=${process.platform}`;
|
const ANNOUNCEMENT_URL =
|
||||||
|
`${config.ANNOUNCEMENT_URL}?version=${config.APP_VERSION}&platform=${process.platform}`
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In certain situations, the WebTorrent team may need to show an announcement to
|
* In certain situations, the WebTorrent team may need to show an announcement to
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ function spawn (playerPath, url, title) {
|
|||||||
|
|
||||||
function kill () {
|
function kill () {
|
||||||
if (!proc) return
|
if (!proc) return
|
||||||
log('Killing external player, pid ' + proc.pid)
|
log(`Killing external player, pid ${proc.pid}`)
|
||||||
proc.kill('SIGKILL') // kill -9
|
proc.kill('SIGKILL') // kill -9
|
||||||
proc = null
|
proc = null
|
||||||
}
|
}
|
||||||
|
|
||||||
function spawnExternal (playerPath, args) {
|
function spawnExternal (playerPath, args) {
|
||||||
log('Running external media player:', playerPath + ' ' + args.join(' '))
|
log('Running external media player:', `${playerPath} ${args.join(' ')}`)
|
||||||
|
|
||||||
if (process.platform === 'darwin' && path.extname(playerPath) === '.app') {
|
if (process.platform === 'darwin' && path.extname(playerPath) === '.app') {
|
||||||
// Mac: Use executable in packaged .app bundle
|
// Mac: Use executable in packaged .app bundle
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ function setAspectRatio (aspectRatio) {
|
|||||||
function setBounds (bounds, maximize) {
|
function setBounds (bounds, maximize) {
|
||||||
// Do nothing in fullscreen
|
// Do nothing in fullscreen
|
||||||
if (!main.win || main.win.isFullScreen()) {
|
if (!main.win || main.win.isFullScreen()) {
|
||||||
log('setBounds: not setting bounds because we\'re in full screen')
|
log(`setBounds: not setting bounds because we're in full screen`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,13 +162,13 @@ function setBounds (bounds, maximize) {
|
|||||||
|
|
||||||
// Assuming we're not maximized or maximizing, set the window size
|
// Assuming we're not maximized or maximizing, set the window size
|
||||||
if (!willBeMaximized) {
|
if (!willBeMaximized) {
|
||||||
log('setBounds: setting bounds to ' + JSON.stringify(bounds))
|
log(`setBounds: setting bounds to ${JSON.stringify(bounds)}`)
|
||||||
if (bounds.x === null && bounds.y === null) {
|
if (bounds.x === null && bounds.y === null) {
|
||||||
// X and Y not specified? By default, center on current screen
|
// X and Y not specified? By default, center on current screen
|
||||||
const scr = electron.screen.getDisplayMatching(main.win.getBounds())
|
const scr = electron.screen.getDisplayMatching(main.win.getBounds())
|
||||||
bounds.x = Math.round(scr.bounds.x + (scr.bounds.width / 2) - (bounds.width / 2))
|
bounds.x = Math.round(scr.bounds.x + (scr.bounds.width / 2) - (bounds.width / 2))
|
||||||
bounds.y = Math.round(scr.bounds.y + (scr.bounds.height / 2) - (bounds.height / 2))
|
bounds.y = Math.round(scr.bounds.y + (scr.bounds.height / 2) - (bounds.height / 2))
|
||||||
log('setBounds: centered to ' + JSON.stringify(bounds))
|
log(`setBounds: centered to ${JSON.stringify(bounds)}`)
|
||||||
}
|
}
|
||||||
// Resize the window's content area (so window border doesn't need to be taken
|
// Resize the window's content area (so window border doesn't need to be taken
|
||||||
// into account)
|
// into account)
|
||||||
|
|||||||
Reference in New Issue
Block a user