standard
This commit is contained in:
@@ -449,51 +449,51 @@ function buildWin32 (cb) {
|
||||
usePackageJson: false,
|
||||
version: pkg.version
|
||||
})
|
||||
.then(function () {
|
||||
console.log(`Windows: Created ${destArch} installer.`)
|
||||
.then(function () {
|
||||
console.log(`Windows: Created ${destArch} installer.`)
|
||||
|
||||
/**
|
||||
/**
|
||||
* Delete extraneous Squirrel files (i.e. *.nupkg delta files for older
|
||||
* versions of the app)
|
||||
*/
|
||||
fs.readdirSync(DIST_PATH)
|
||||
.filter((name) => name.endsWith('.nupkg') && !name.includes(pkg.version))
|
||||
.forEach((filename) => {
|
||||
fs.unlinkSync(path.join(DIST_PATH, filename))
|
||||
})
|
||||
fs.readdirSync(DIST_PATH)
|
||||
.filter((name) => name.endsWith('.nupkg') && !name.includes(pkg.version))
|
||||
.forEach((filename) => {
|
||||
fs.unlinkSync(path.join(DIST_PATH, filename))
|
||||
})
|
||||
|
||||
if (destArch === 'ia32') {
|
||||
console.log('Windows: Renaming ia32 installer files...')
|
||||
if (destArch === 'ia32') {
|
||||
console.log('Windows: Renaming ia32 installer files...')
|
||||
|
||||
// RELEASES -> RELEASES-ia32
|
||||
const relPath = path.join(DIST_PATH, 'RELEASES-ia32')
|
||||
fs.renameSync(
|
||||
path.join(DIST_PATH, 'RELEASES'),
|
||||
relPath
|
||||
)
|
||||
// RELEASES -> RELEASES-ia32
|
||||
const relPath = path.join(DIST_PATH, 'RELEASES-ia32')
|
||||
fs.renameSync(
|
||||
path.join(DIST_PATH, 'RELEASES'),
|
||||
relPath
|
||||
)
|
||||
|
||||
// WebTorrent-vX.X.X-full.nupkg -> WebTorrent-vX.X.X-ia32-full.nupkg
|
||||
fs.renameSync(
|
||||
path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-full.nupkg`),
|
||||
path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-ia32-full.nupkg`)
|
||||
)
|
||||
// WebTorrent-vX.X.X-full.nupkg -> WebTorrent-vX.X.X-ia32-full.nupkg
|
||||
fs.renameSync(
|
||||
path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-full.nupkg`),
|
||||
path.join(DIST_PATH, `${config.APP_NAME}-${config.APP_VERSION}-ia32-full.nupkg`)
|
||||
)
|
||||
|
||||
// Change file name inside RELEASES-ia32 to match renamed file
|
||||
const relContent = fs.readFileSync(relPath, 'utf8')
|
||||
const relContent32 = relContent.replace('full.nupkg', 'ia32-full.nupkg')
|
||||
fs.writeFileSync(relPath, relContent32)
|
||||
// Change file name inside RELEASES-ia32 to match renamed file
|
||||
const relContent = fs.readFileSync(relPath, 'utf8')
|
||||
const relContent32 = relContent.replace('full.nupkg', 'ia32-full.nupkg')
|
||||
fs.writeFileSync(relPath, relContent32)
|
||||
|
||||
if (relContent === relContent32) {
|
||||
if (relContent === relContent32) {
|
||||
// Sanity check
|
||||
throw new Error('Fixing RELEASES-ia32 failed. Replacement did not modify the file.')
|
||||
throw new Error('Fixing RELEASES-ia32 failed. Replacement did not modify the file.')
|
||||
}
|
||||
|
||||
console.log('Windows: Renamed ia32 installer files.')
|
||||
}
|
||||
|
||||
console.log('Windows: Renamed ia32 installer files.')
|
||||
}
|
||||
|
||||
cb(null)
|
||||
})
|
||||
.catch(cb)
|
||||
cb(null)
|
||||
})
|
||||
.catch(cb)
|
||||
}
|
||||
|
||||
function packagePortable (filesPath, destArch, cb) {
|
||||
|
||||
@@ -188,7 +188,7 @@ function onAppOpen (newArgv) {
|
||||
function sliceArgv (argv) {
|
||||
return argv.slice(config.IS_PRODUCTION ? 1
|
||||
: config.IS_TEST ? 4
|
||||
: 2)
|
||||
: 2)
|
||||
}
|
||||
|
||||
function processArgv (argv) {
|
||||
|
||||
@@ -102,10 +102,10 @@ module.exports = class PlaybackController {
|
||||
const state = this.state
|
||||
if (Playlist.hasNext(state) && state.playing.location !== 'external') {
|
||||
this.updatePlayer(
|
||||
state.playing.infoHash, Playlist.getNextIndex(state), false, (err) => {
|
||||
if (err) dispatch('error', err)
|
||||
else this.play()
|
||||
})
|
||||
state.playing.infoHash, Playlist.getNextIndex(state), false, (err) => {
|
||||
if (err) dispatch('error', err)
|
||||
else this.play()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ module.exports = class PlaybackController {
|
||||
state.playing.fileIndex = index
|
||||
state.playing.type = TorrentPlayer.isVideo(fileSummary) ? 'video'
|
||||
: TorrentPlayer.isAudio(fileSummary) ? 'audio'
|
||||
: 'other'
|
||||
: 'other'
|
||||
|
||||
// pick up where we left off
|
||||
let jumpToTime = 0
|
||||
|
||||
@@ -157,17 +157,17 @@ module.exports = class TorrentListController {
|
||||
|
||||
prioritizeTorrent (infoHash) {
|
||||
this.state.saved.torrents
|
||||
.filter((torrent) => { // We're interested in active torrents only.
|
||||
return (['downloading', 'seeding'].indexOf(torrent.status) !== -1)
|
||||
})
|
||||
.map((torrent) => { // Pause all active torrents except the one that started playing.
|
||||
if (infoHash === torrent.infoHash) return
|
||||
.filter((torrent) => { // We're interested in active torrents only.
|
||||
return (['downloading', 'seeding'].indexOf(torrent.status) !== -1)
|
||||
})
|
||||
.map((torrent) => { // Pause all active torrents except the one that started playing.
|
||||
if (infoHash === torrent.infoHash) return
|
||||
|
||||
// Pause torrent without playing sounds.
|
||||
this.pauseTorrent(torrent, false)
|
||||
// Pause torrent without playing sounds.
|
||||
this.pauseTorrent(torrent, false)
|
||||
|
||||
this.state.saved.torrentsToResume.push(torrent.infoHash)
|
||||
})
|
||||
this.state.saved.torrentsToResume.push(torrent.infoHash)
|
||||
})
|
||||
|
||||
console.log('Playback Priority: paused torrents: ', this.state.saved.torrentsToResume)
|
||||
}
|
||||
|
||||
@@ -498,9 +498,9 @@ function renderPlayerControls (state) {
|
||||
const volume = state.playing.volume
|
||||
const volumeIcon = 'volume_' + (
|
||||
volume === 0 ? 'off'
|
||||
: volume < 0.3 ? 'mute'
|
||||
: volume < 0.6 ? 'down'
|
||||
: 'up')
|
||||
: volume < 0.3 ? 'mute'
|
||||
: volume < 0.6 ? 'down'
|
||||
: 'up')
|
||||
const volumeStyle = {
|
||||
background: '-webkit-gradient(linear, left top, right top, ' +
|
||||
'color-stop(' + (volume * 100) + '%, #eee), ' +
|
||||
|
||||
@@ -98,7 +98,7 @@ function init () {
|
||||
|
||||
window.addEventListener('error', (e) =>
|
||||
ipc.send('wt-uncaught-error', {message: e.error.message, stack: e.error.stack}),
|
||||
true)
|
||||
true)
|
||||
|
||||
setInterval(updateTorrentProgress, 1000)
|
||||
console.timeEnd('init')
|
||||
|
||||
@@ -10,7 +10,7 @@ test('app runs', function (t) {
|
||||
setup.waitForLoad(app, t)
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'app-basic'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
require('./test-torrent-list')
|
||||
|
||||
@@ -30,7 +30,7 @@ test('add-torrent', function (t) {
|
||||
.then(() => app.client.moveToObject('.torrent'))
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'add-torrent-100-percent'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
test('create-torrent', function (t) {
|
||||
@@ -84,5 +84,5 @@ test('create-torrent', function (t) {
|
||||
config.SAVED_TORRENT_FILE,
|
||||
expectedTorrent))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
@@ -53,5 +53,5 @@ test('audio-streaming', function (t) {
|
||||
.then(() => app.webContents.executeJavaScript('dispatch("skipTo", 2)'))
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-wired-5'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
@@ -22,7 +22,7 @@ test('torrent-list: show download path missing', function (t) {
|
||||
.then((windowTitle) => t.equal(windowTitle, 'Preferences', 'window title'))
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'prefs-basic'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
test('torrent-list: start, stop, and delete torrents', function (t) {
|
||||
@@ -54,7 +54,7 @@ test('torrent-list: start, stop, and delete torrents', function (t) {
|
||||
.then(() => app.client.click('.control.ok'))
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'torrent-list-deleted'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
test('torrent-list: expand torrent, unselect file', function (t) {
|
||||
@@ -101,5 +101,5 @@ test('torrent-list: expand torrent, unselect file', function (t) {
|
||||
// Make sure that all the files are gone
|
||||
.then(() => setup.compareDownloadFolder(t, 'CosmosLaundromatFirstCycle', null))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
@@ -31,5 +31,5 @@ test('video-streaming', function (t) {
|
||||
// Take another screenshot to verify that the window resized correctly
|
||||
.then(() => setup.screenshotCreateOrCompare(app, t, 'play-torrent-return'))
|
||||
.then(() => setup.endTest(app, t),
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
(err) => setup.endTest(app, t, err || 'error'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user