Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa42627d45 | ||
|
|
bd6dc1a7c1 | ||
|
|
dfedbcea32 | ||
|
|
d930b97b30 | ||
|
|
de7899c8f8 | ||
|
|
2f53c5e137 | ||
|
|
ff54f48abb | ||
|
|
a7766e8d3f | ||
|
|
844e34e596 | ||
|
|
8515fee681 | ||
|
|
10a1ee3a09 | ||
|
|
a1b2641130 | ||
|
|
bb55b3fab2 | ||
|
|
57d02aa316 | ||
|
|
3a92f596ff | ||
|
|
60b4365a76 | ||
|
|
cb0ad73c80 | ||
|
|
9c865050bb | ||
|
|
0edeaa4d58 | ||
|
|
dfd1ca3a8e | ||
|
|
75d9939b98 | ||
|
|
f88d5426c9 | ||
|
|
1b7d4f09a9 | ||
|
|
680376c4a6 | ||
|
|
15cca44bd2 | ||
|
|
29d17870cb | ||
|
|
c150d22c97 | ||
|
|
4e0c1ed393 | ||
|
|
c6240c3253 | ||
|
|
5deb0d7e9a | ||
|
|
803cce808b | ||
|
|
8e89c0962b | ||
|
|
50cc394a27 | ||
|
|
0165d541b8 | ||
|
|
5af36428fa | ||
|
|
48ad571a59 | ||
|
|
57a003d7c5 | ||
|
|
5f5b13d7fe | ||
|
|
97426621bf |
@@ -77,5 +77,7 @@
|
|||||||
- Ameet Kaustav (akaustav@users.noreply.github.com)
|
- Ameet Kaustav (akaustav@users.noreply.github.com)
|
||||||
- gpatarin (gael.patarin@outlook.com)
|
- gpatarin (gael.patarin@outlook.com)
|
||||||
- Gael Patarin (gael.patarin@outlook.com)
|
- Gael Patarin (gael.patarin@outlook.com)
|
||||||
|
- Subin Siby (mail@subinsb.com)
|
||||||
|
- Hinara (hinara.turevel@gmail.com)
|
||||||
|
|
||||||
#### Generated by bin/update-authors.sh.
|
#### Generated by bin/update-authors.sh.
|
||||||
|
|||||||
39
CHANGELOG.md
39
CHANGELOG.md
@@ -1,7 +1,38 @@
|
|||||||
# WebTorrent Desktop Version History
|
# WebTorrent Desktop Version History
|
||||||
|
|
||||||
|
## v0.24.0 - 2020-08-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support the `.m2ts` video container format ([hicom150](https://github.com/hicom150))
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Electron 10.1.0 [\#1864](https://github.com/webtorrent/webtorrent-desktop/pull/1864) ([feross](https://github.com/feross))
|
||||||
|
- Update the Windows installer loading image [\#1841](https://github.com/webtorrent/webtorrent-desktop/pull/1841) ([alxhotel](https://github.com/alxhotel))
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix music metadata not showing up [\#1847](https://github.com/webtorrent/webtorrent-desktop/pull/1847) ([Borewit](https://github.com/Borewit))
|
||||||
|
- Fix the "Play in VLC" functionality [\#1850](https://github.com/webtorrent/webtorrent-desktop/pull/1850) ([Hinara](https://github.com/Hinara))
|
||||||
|
- Prevent shortcuts from activating when user input elements are focused [\#1840](https://github.com/webtorrent/webtorrent-desktop/pull/1840) ([subins2000](https://github.com/subins2000))
|
||||||
|
|
||||||
|
## v0.23.0 - 2020-07-15
|
||||||
|
|
||||||
|
🔒 This release contains a critical security fix. Please update as soon as possible.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add macOS Notarization [\#1834](https://github.com/webtorrent/webtorrent-desktop/pull/1834) ([feross](https://github.com/feross))
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Electron 10 beta [\#1834](https://github.com/webtorrent/webtorrent-desktop/pull/1834) ([feross](https://github.com/feross))
|
||||||
|
|
||||||
## v0.22.0 - 2020-07-15
|
## v0.22.0 - 2020-07-15
|
||||||
|
|
||||||
|
❤️✨ A new version of WebTorrent Desktop is out! ❤️✨
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Linux `.rpm` packages and `arm64` builds are now available! [\#1694](https://github.com/webtorrent/webtorrent-desktop/pull/1694) ([hicom150](https://github.com/hicom150))
|
- Linux `.rpm` packages and `arm64` builds are now available! [\#1694](https://github.com/webtorrent/webtorrent-desktop/pull/1694) ([hicom150](https://github.com/hicom150))
|
||||||
@@ -9,13 +40,13 @@
|
|||||||
- Improve codec unsupported detection [\#1711](https://github.com/webtorrent/webtorrent-desktop/pull/1711) ([hicom150](https://github.com/hicom150))
|
- Improve codec unsupported detection [\#1711](https://github.com/webtorrent/webtorrent-desktop/pull/1711) ([hicom150](https://github.com/hicom150))
|
||||||
- Report when files are being verified [\#1717](https://github.com/webtorrent/webtorrent-desktop/pull/1717) ([pR0Ps](https://github.com/pR0Ps))
|
- Report when files are being verified [\#1717](https://github.com/webtorrent/webtorrent-desktop/pull/1717) ([pR0Ps](https://github.com/pR0Ps))
|
||||||
- Support additional audio files: MPEG-Layer-2, Musepack, Matroska audio, WavePack [\#1772](https://github.com/webtorrent/webtorrent-desktop/pull/1772)
|
- Support additional audio files: MPEG-Layer-2, Musepack, Matroska audio, WavePack [\#1772](https://github.com/webtorrent/webtorrent-desktop/pull/1772)
|
||||||
- Update to Electron 9 [\#1729](https://github.com/webtorrent/webtorrent-desktop/pull/1729) [\#1832](https://github.com/webtorrent/webtorrent-desktop/issues/1832)
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Update to Electron 9 [\#1729](https://github.com/webtorrent/webtorrent-desktop/pull/1729) [\#1832](https://github.com/webtorrent/webtorrent-desktop/issues/1832)
|
||||||
- Update to music-metadata 4.8.0 [\#1719](https://github.com/webtorrent/webtorrent-desktop/pull/1719) ([Borewit](https://github.com/Borewit))
|
- Update to music-metadata 4.8.0 [\#1719](https://github.com/webtorrent/webtorrent-desktop/pull/1719) ([Borewit](https://github.com/Borewit))
|
||||||
- Update Windows build documentation [\#1715](https://github.com/webtorrent/webtorrent-desktop/pull/1715) ([RecoX](https://github.com/RecoX))
|
- Update Windows build documentation [\#1715](https://github.com/webtorrent/webtorrent-desktop/pull/1715) ([RecoX](https://github.com/RecoX))
|
||||||
- Remove unneeded dependencies
|
- Remove unneeded dependencies ([feross](https://github.com/feross))
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
@@ -24,8 +55,8 @@
|
|||||||
- Fix percentage rounding error [\#1716](https://github.com/webtorrent/webtorrent-desktop/pull/1716) ([pR0Ps](https://github.com/pR0Ps))
|
- Fix percentage rounding error [\#1716](https://github.com/webtorrent/webtorrent-desktop/pull/1716) ([pR0Ps](https://github.com/pR0Ps))
|
||||||
- Fix path-selector in preferences page [\#1702](https://github.com/webtorrent/webtorrent-desktop/pull/1702) ([314eter](https://github.com/314eter))
|
- Fix path-selector in preferences page [\#1702](https://github.com/webtorrent/webtorrent-desktop/pull/1702) ([314eter](https://github.com/314eter))
|
||||||
- Fix path-selector in preferences page [\#1704](https://github.com/webtorrent/webtorrent-desktop/pull/1702) ([mathiasvr](https://github.com/mathiasvr))
|
- Fix path-selector in preferences page [\#1704](https://github.com/webtorrent/webtorrent-desktop/pull/1702) ([mathiasvr](https://github.com/mathiasvr))
|
||||||
- Fix: Increase height of 'About' window [\#1737](https://github.com/webtorrent/webtorrent-desktop/pull/1737)
|
- Fix: Increase height of 'About' window [\#1737](https://github.com/webtorrent/webtorrent-desktop/pull/1737) ([akaustav](https://github.com/akaustav))
|
||||||
- Fix "Save Torrent File As..." [\#1743](https://github.com/webtorrent/webtorrent-desktop/pull/1743)
|
- Fix "Save Torrent File As..." [\#1743](https://github.com/webtorrent/webtorrent-desktop/pull/1743) ([gpatarin](https://github.com/gpatarin))
|
||||||
|
|
||||||
## v0.21.0 - 2019-09-14
|
## v0.21.0 - 2019-09-14
|
||||||
|
|
||||||
|
|||||||
12
bin/darwin-entitlements.plist
Normal file
12
bin/darwin-entitlements.plist
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.debugger</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -266,6 +266,7 @@ function buildDarwin (cb) {
|
|||||||
|
|
||||||
function signApp (cb) {
|
function signApp (cb) {
|
||||||
const sign = require('electron-osx-sign')
|
const sign = require('electron-osx-sign')
|
||||||
|
const { notarize } = require('electron-notarize')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sign the app with Apple Developer ID certificates. We sign the app for 2 reasons:
|
* Sign the app with Apple Developer ID certificates. We sign the app for 2 reasons:
|
||||||
@@ -281,16 +282,37 @@ function buildDarwin (cb) {
|
|||||||
* - Membership in the Apple Developer Program
|
* - Membership in the Apple Developer Program
|
||||||
*/
|
*/
|
||||||
const signOpts = {
|
const signOpts = {
|
||||||
|
verbose: true,
|
||||||
app: appPath,
|
app: appPath,
|
||||||
platform: 'darwin',
|
platform: 'darwin',
|
||||||
verbose: true
|
identity: 'Developer ID Application: WebTorrent, LLC (5MAMC8G3L8)',
|
||||||
|
hardenedRuntime: true,
|
||||||
|
entitlements: path.join(config.ROOT_PATH, 'bin', 'darwin-entitlements.plist'),
|
||||||
|
'entitlements-inherit': path.join(config.ROOT_PATH, 'bin', 'darwin-entitlements.plist'),
|
||||||
|
'signature-flags': 'library'
|
||||||
|
}
|
||||||
|
|
||||||
|
const notarizeOpts = {
|
||||||
|
appBundleId: darwin.appBundleId,
|
||||||
|
appPath,
|
||||||
|
appleId: 'feross@feross.org',
|
||||||
|
appleIdPassword: '@keychain:AC_PASSWORD'
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Mac: Signing app...')
|
console.log('Mac: Signing app...')
|
||||||
sign(signOpts, function (err) {
|
sign(signOpts, function (err) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
console.log('Mac: Signed app.')
|
console.log('Mac: Signed app.')
|
||||||
cb(null)
|
|
||||||
|
console.log('Mac: Notarizing app...')
|
||||||
|
notarize(notarizeOpts).then(
|
||||||
|
function () {
|
||||||
|
console.log('Mac: Notarized app.')
|
||||||
|
cb(null)
|
||||||
|
},
|
||||||
|
function (err) {
|
||||||
|
cb(err)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4373
package-lock.json
generated
4373
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "webtorrent-desktop",
|
"name": "webtorrent-desktop",
|
||||||
"description": "WebTorrent, the streaming torrent client. For Mac, Windows, and Linux.",
|
"description": "WebTorrent, the streaming torrent client. For Mac, Windows, and Linux.",
|
||||||
"version": "0.22.0",
|
"version": "0.24.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "WebTorrent, LLC",
|
"name": "WebTorrent, LLC",
|
||||||
"email": "feross@webtorrent.io",
|
"email": "feross@webtorrent.io",
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
"arch": "^2.1.2",
|
"arch": "^2.1.2",
|
||||||
"auto-launch": "^5.0.5",
|
"auto-launch": "^5.0.5",
|
||||||
"bitfield": "^3.0.0",
|
"bitfield": "^3.0.0",
|
||||||
"capture-frame": "^3.0.2",
|
"capture-frame": "^4.0.0",
|
||||||
"chokidar": "^3.4.0",
|
"chokidar": "^3.4.2",
|
||||||
"chromecasts": "^1.9.1",
|
"chromecasts": "^1.9.1",
|
||||||
"create-torrent": "^4.4.2",
|
"create-torrent": "^4.4.2",
|
||||||
"debounce": "^1.2.0",
|
"debounce": "^1.2.0",
|
||||||
@@ -25,11 +25,11 @@
|
|||||||
"drag-drop": "^6.0.2",
|
"drag-drop": "^6.0.2",
|
||||||
"es6-error": "^4.1.1",
|
"es6-error": "^4.1.1",
|
||||||
"fn-getter": "^1.0.0",
|
"fn-getter": "^1.0.0",
|
||||||
"iso-639-1": "^2.1.3",
|
"iso-639-1": "^2.1.4",
|
||||||
"languagedetect": "^2.0.0",
|
"languagedetect": "^2.0.0",
|
||||||
"location-history": "^1.1.2",
|
"location-history": "^1.1.2",
|
||||||
"material-ui": "^0.20.2",
|
"material-ui": "^0.20.2",
|
||||||
"music-metadata": "6.3.6",
|
"music-metadata": "^7.0.2",
|
||||||
"network-address": "^1.1.2",
|
"network-address": "^1.1.2",
|
||||||
"parse-torrent": "^7.1.3",
|
"parse-torrent": "^7.1.3",
|
||||||
"prettier-bytes": "^1.0.4",
|
"prettier-bytes": "^1.0.4",
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"run-parallel": "^1.1.9",
|
"run-parallel": "^1.1.9",
|
||||||
"semver": "^7.3.2",
|
"semver": "^7.3.2",
|
||||||
"simple-concat": "^1.0.0",
|
"simple-concat": "^1.0.1",
|
||||||
"simple-get": "^4.0.0",
|
"simple-get": "^4.0.0",
|
||||||
"srt-to-vtt": "^1.1.3",
|
"srt-to-vtt": "^1.1.3",
|
||||||
"vlc-command": "^1.2.0",
|
"vlc-command": "^1.2.0",
|
||||||
@@ -50,19 +50,20 @@
|
|||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"buble": "^0.20.0",
|
"buble": "^0.20.0",
|
||||||
"cross-zip": "^3.1.0",
|
"cross-zip": "^3.1.0",
|
||||||
"depcheck": "^1.0.0",
|
"depcheck": "^1.2.0",
|
||||||
"electron": "~9.1.0",
|
"electron": "~10.1.0",
|
||||||
|
"electron-notarize": "^1.0.0",
|
||||||
"electron-osx-sign": "^0.4.17",
|
"electron-osx-sign": "^0.4.17",
|
||||||
"electron-packager": "^15.0.0",
|
"electron-packager": "^15.1.0",
|
||||||
"electron-winstaller": "^4.0.1",
|
"electron-winstaller": "^4.0.1",
|
||||||
"gh-release": "^3.5.0",
|
"gh-release": "^3.5.0",
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"nodemon": "^2.0.4",
|
"nodemon": "^2.0.4",
|
||||||
"open": "^7.0.4",
|
"open": "^7.2.1",
|
||||||
"plist": "^3.0.1",
|
"plist": "^3.0.1",
|
||||||
"pngjs": "^5.0.0",
|
"pngjs": "^5.0.0",
|
||||||
"run-series": "^1.1.8",
|
"run-series": "^1.1.8",
|
||||||
"spectron": "~11.0.0",
|
"spectron": "~11.1.0",
|
||||||
"standard": "*",
|
"standard": "*",
|
||||||
"tape": "^5.0.1",
|
"tape": "^5.0.1",
|
||||||
"walk-sync": "^2.2.0"
|
"walk-sync": "^2.2.0"
|
||||||
@@ -86,7 +87,7 @@
|
|||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"appdmg": "^0.6.0",
|
"appdmg": "^0.6.0",
|
||||||
"electron-installer-debian": "^3.1.0",
|
"electron-installer-debian": "^3.1.0",
|
||||||
"electron-installer-redhat": "^3.1.0"
|
"electron-installer-redhat": "^3.2.0"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"productName": "WebTorrent",
|
"productName": "WebTorrent",
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ function init () {
|
|||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
|
|
||||||
electron.crashReporter.start({
|
electron.crashReporter.start({
|
||||||
companyName: config.APP_NAME,
|
|
||||||
productName: config.APP_NAME,
|
productName: config.APP_NAME,
|
||||||
submitURL: config.CRASH_REPORT_URL
|
submitURL: config.CRASH_REPORT_URL,
|
||||||
|
globalExtra: { _companyName: config.APP_NAME },
|
||||||
|
compress: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ let proc = null
|
|||||||
function checkInstall (playerPath, cb) {
|
function checkInstall (playerPath, cb) {
|
||||||
// check for VLC if external player has not been specified by the user
|
// check for VLC if external player has not been specified by the user
|
||||||
// otherwise assume the player is installed
|
// otherwise assume the player is installed
|
||||||
if (playerPath == null) return vlcCommand(cb)
|
if (!playerPath) return vlcCommand(cb)
|
||||||
process.nextTick(() => cb(null))
|
process.nextTick(() => cb(null))
|
||||||
}
|
}
|
||||||
|
|
||||||
function spawn (playerPath, url, title) {
|
function spawn (playerPath, url, title) {
|
||||||
if (playerPath != null) return spawnExternal(playerPath, [url])
|
if (playerPath) return spawnExternal(playerPath, [url])
|
||||||
|
|
||||||
// Try to find and use VLC if external player is not specified
|
// Try to find and use VLC if external player is not specified
|
||||||
vlcCommand((err, vlcPath) => {
|
vlcCommand((err, vlcPath) => {
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ console.time('init')
|
|||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const app = electron.app
|
const app = electron.app
|
||||||
|
|
||||||
|
// Start crash reporter early, so it takes effect for child processes
|
||||||
|
const crashReporter = require('../crash-reporter')
|
||||||
|
crashReporter.init()
|
||||||
|
|
||||||
const parallel = require('run-parallel')
|
const parallel = require('run-parallel')
|
||||||
|
|
||||||
const config = require('../config')
|
const config = require('../config')
|
||||||
const crashReporter = require('../crash-reporter')
|
|
||||||
const ipc = require('./ipc')
|
const ipc = require('./ipc')
|
||||||
const log = require('./log')
|
const log = require('./log')
|
||||||
const menu = require('./menu')
|
const menu = require('./menu')
|
||||||
@@ -109,10 +112,6 @@ function init () {
|
|||||||
|
|
||||||
ipc.init()
|
ipc.init()
|
||||||
|
|
||||||
app.once('will-finish-launching', function () {
|
|
||||||
crashReporter.init()
|
|
||||||
})
|
|
||||||
|
|
||||||
app.once('ipcReady', function () {
|
app.once('ipcReady', function () {
|
||||||
log('Command line args:', argv)
|
log('Command line args:', argv)
|
||||||
processArgv(argv)
|
processArgv(argv)
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ module.exports = {
|
|||||||
handleEvent
|
handleEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
const cp = require('child_process')
|
|
||||||
const electron = require('electron')
|
|
||||||
const fs = require('fs')
|
|
||||||
const os = require('os')
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const spawn = require('child_process').spawn
|
||||||
|
const electron = require('electron')
|
||||||
|
|
||||||
const app = electron.app
|
const app = electron.app
|
||||||
|
|
||||||
@@ -15,137 +13,29 @@ const handlers = require('./handlers')
|
|||||||
const EXE_NAME = path.basename(process.execPath)
|
const EXE_NAME = path.basename(process.execPath)
|
||||||
const UPDATE_EXE = path.join(process.execPath, '..', '..', 'Update.exe')
|
const UPDATE_EXE = path.join(process.execPath, '..', '..', 'Update.exe')
|
||||||
|
|
||||||
function handleEvent (cmd) {
|
const run = function (args, done) {
|
||||||
if (cmd === '--squirrel-install') {
|
spawn(UPDATE_EXE, args, { detached: true })
|
||||||
// App was installed. Install desktop/start menu shortcuts.
|
.on('close', done)
|
||||||
createShortcuts(function () {
|
}
|
||||||
// Ensure user sees install splash screen so they realize that Setup.exe actually
|
|
||||||
// installed an application and isn't the application itself.
|
|
||||||
setTimeout(function () {
|
|
||||||
app.quit()
|
|
||||||
}, 3000)
|
|
||||||
})
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd === '--squirrel-updated') {
|
function handleEvent (cmd) {
|
||||||
// App was updated. (Called on new version of app)
|
if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
|
||||||
updateShortcuts(function () {
|
run([`--createShortcut=${EXE_NAME}`], app.quit)
|
||||||
app.quit()
|
|
||||||
})
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd === '--squirrel-uninstall') {
|
if (cmd === '--squirrel-uninstall') {
|
||||||
// App was just uninstalled. Undo anything we did in the --squirrel-install and
|
|
||||||
// --squirrel-updated handlers
|
|
||||||
|
|
||||||
// Uninstall .torrent file and magnet link handlers
|
// Uninstall .torrent file and magnet link handlers
|
||||||
handlers.uninstall()
|
handlers.uninstall()
|
||||||
|
|
||||||
// Remove desktop/start menu shortcuts.
|
run([`--removeShortcut=${EXE_NAME}`], app.quit)
|
||||||
// HACK: add a callback to handlers.uninstall() so we can remove this setTimeout
|
|
||||||
setTimeout(function () {
|
|
||||||
removeShortcuts(function () {
|
|
||||||
app.quit()
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd === '--squirrel-obsolete') {
|
if (cmd === '--squirrel-obsolete') {
|
||||||
// App will be updated. (Called on outgoing version of app)
|
|
||||||
app.quit()
|
app.quit()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd === '--squirrel-firstrun') {
|
|
||||||
// App is running for the first time. Do not quit, allow startup to continue.
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Spawn a command and invoke the callback when it completes with an error and
|
|
||||||
* the output from standard out.
|
|
||||||
*/
|
|
||||||
function spawn (command, args, cb) {
|
|
||||||
let stdout = ''
|
|
||||||
let error = null
|
|
||||||
let child = null
|
|
||||||
try {
|
|
||||||
child = cp.spawn(command, args)
|
|
||||||
} catch (err) {
|
|
||||||
// Spawn can throw an error
|
|
||||||
process.nextTick(function () {
|
|
||||||
cb(error, stdout)
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
child.stdout.on('data', function (data) {
|
|
||||||
stdout += data
|
|
||||||
})
|
|
||||||
|
|
||||||
child.on('error', function (processError) {
|
|
||||||
error = processError
|
|
||||||
})
|
|
||||||
|
|
||||||
child.on('close', function (code, signal) {
|
|
||||||
if (code !== 0 && !error) error = new Error('Command failed: #{signal || code}')
|
|
||||||
if (error) error.stdout = stdout
|
|
||||||
cb(error, stdout)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spawn the Squirrel `Update.exe` command with the given arguments and invoke
|
|
||||||
* the callback when the command completes.
|
|
||||||
*/
|
|
||||||
function spawnUpdate (args, cb) {
|
|
||||||
spawn(UPDATE_EXE, args, cb)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create desktop and start menu shortcuts using the Squirrel `Update.exe`
|
|
||||||
* command.
|
|
||||||
*/
|
|
||||||
function createShortcuts (cb) {
|
|
||||||
spawnUpdate(['--createShortcut', EXE_NAME], cb)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update desktop and start menu shortcuts using the Squirrel `Update.exe`
|
|
||||||
* command.
|
|
||||||
*/
|
|
||||||
function updateShortcuts (cb) {
|
|
||||||
const homeDir = os.homedir()
|
|
||||||
if (homeDir) {
|
|
||||||
const desktopShortcutPath = path.join(homeDir, 'Desktop', 'WebTorrent.lnk')
|
|
||||||
// If the desktop shortcut was deleted by the user, then keep it deleted.
|
|
||||||
fs.access(desktopShortcutPath, function (err) {
|
|
||||||
const desktopShortcutExists = !err
|
|
||||||
createShortcuts(function () {
|
|
||||||
if (desktopShortcutExists) {
|
|
||||||
cb()
|
|
||||||
} else {
|
|
||||||
// Remove the unwanted desktop shortcut that was recreated
|
|
||||||
fs.unlink(desktopShortcutPath, cb)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
createShortcuts(cb)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove desktop and start menu shortcuts using the Squirrel `Update.exe`
|
|
||||||
* command.
|
|
||||||
*/
|
|
||||||
function removeShortcuts (cb) {
|
|
||||||
spawnUpdate(['--removeShortcut', EXE_NAME], cb)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ function init () {
|
|||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
enableBlinkFeatures: 'AudioVideoTracks'
|
enableBlinkFeatures: 'AudioVideoTracks',
|
||||||
|
enableRemoteModule: true
|
||||||
},
|
},
|
||||||
width: 300
|
width: 300
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ function init (state, options) {
|
|||||||
width: initialBounds.width,
|
width: initialBounds.width,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
enableBlinkFeatures: 'AudioVideoTracks'
|
enableBlinkFeatures: 'AudioVideoTracks',
|
||||||
|
enableRemoteModule: true
|
||||||
},
|
},
|
||||||
x: initialBounds.x,
|
x: initialBounds.x,
|
||||||
y: initialBounds.y
|
y: initialBounds.y
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ function init () {
|
|||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
enableBlinkFeatures: 'AudioVideoTracks'
|
enableBlinkFeatures: 'AudioVideoTracks',
|
||||||
|
enableRemoteModule: true
|
||||||
},
|
},
|
||||||
width: 150
|
width: 150
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const mediaExtensions = {
|
|||||||
'.ogg', '.opus', '.spx', '.wma', '.wav', '.wv', '.wvp'],
|
'.ogg', '.opus', '.spx', '.wma', '.wav', '.wv', '.wvp'],
|
||||||
video: [
|
video: [
|
||||||
'.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', '.mpg', '.mpeg',
|
'.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', '.mpg', '.mpeg',
|
||||||
'.ogv', '.webm', '.wmv'],
|
'.ogv', '.webm', '.wmv', '.m2ts'],
|
||||||
image: ['.gif', '.jpg', '.jpeg', '.png']
|
image: ['.gif', '.jpg', '.jpeg', '.png']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,8 @@ function torrentPosterFromVideo (torrent, cb) {
|
|||||||
function onSeeked () {
|
function onSeeked () {
|
||||||
video.removeEventListener('seeked', onSeeked)
|
video.removeEventListener('seeked', onSeeked)
|
||||||
|
|
||||||
const buf = captureFrame(video)
|
const frame = captureFrame(video)
|
||||||
|
const buf = frame && frame.image
|
||||||
|
|
||||||
// unload video element
|
// unload video element
|
||||||
video.pause()
|
video.pause()
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ Module.prototype.require = function (id) {
|
|||||||
|
|
||||||
console.time('init')
|
console.time('init')
|
||||||
|
|
||||||
const crashReporter = require('../crash-reporter')
|
|
||||||
crashReporter.init()
|
|
||||||
|
|
||||||
// Perf optimization: Start asynchronously read on config file before all the
|
// Perf optimization: Start asynchronously read on config file before all the
|
||||||
// blocking require() calls below.
|
// blocking require() calls below.
|
||||||
|
|
||||||
@@ -524,6 +521,9 @@ function onPaste (e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onKeydown (e) {
|
function onKeydown (e) {
|
||||||
|
// prevent event fire on user input elements
|
||||||
|
if (editableHtmlTags.has(e.target.tagName.toLowerCase())) return
|
||||||
|
|
||||||
const key = e.key
|
const key = e.key
|
||||||
|
|
||||||
if (key === 'ArrowLeft') {
|
if (key === 'ArrowLeft') {
|
||||||
|
|||||||
@@ -12,14 +12,10 @@ const networkAddress = require('network-address')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const WebTorrent = require('webtorrent')
|
const WebTorrent = require('webtorrent')
|
||||||
|
|
||||||
const crashReporter = require('../crash-reporter')
|
|
||||||
const config = require('../config')
|
const config = require('../config')
|
||||||
const { TorrentKeyNotFoundError } = require('./lib/errors')
|
const { TorrentKeyNotFoundError } = require('./lib/errors')
|
||||||
const torrentPoster = require('./lib/torrent-poster')
|
const torrentPoster = require('./lib/torrent-poster')
|
||||||
|
|
||||||
// Report when the process crashes
|
|
||||||
crashReporter.init()
|
|
||||||
|
|
||||||
// Send & receive messages from the main window
|
// Send & receive messages from the main window
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
|
|
||||||
@@ -347,7 +343,10 @@ function getAudioMetadata (infoHash, index) {
|
|||||||
skipCovers: true,
|
skipCovers: true,
|
||||||
fileSize: file.length,
|
fileSize: file.length,
|
||||||
observer: event => {
|
observer: event => {
|
||||||
ipc.send('wt-audio-metadata', infoHash, index, event.metadata)
|
ipc.send('wt-audio-metadata', infoHash, index, {
|
||||||
|
common: metadata.common,
|
||||||
|
format: metadata.format
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onMetadata = file.done
|
const onMetadata = file.done
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 30 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user