Skip to content

Commit

Permalink
Updated Electron to 27.0.3 and added Delete all inactive transfers.
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhApps committed Nov 4, 2023
1 parent ae42c35 commit 52bae1e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "magtorrent",
"productName": "MagTorrent",
"version": "1.0.4",
"version": "1.0.5",
"description": "A torrent app for Desktop, powered by WebTorrent and Electron.",
"main": "src/app.js",
"scripts": {
Expand Down Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@electron/notarize": "^2.1.0",
"electron": "^27.0.0",
"electron": "^27.0.3",
"electron-builder": "^24.6.4"
},
"postinstall": "electron-builder install-app-deps"
Expand Down
32 changes: 31 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const soundPlay = require('sound-play')
const sintel = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent'
const sampleItems = [sintel]

const build_date = '2023.09.01'
const build_date = '2023.11.03'

let webTorrentClient, moveToTrash
let mainWindow
Expand Down Expand Up @@ -267,6 +267,21 @@ function createAppMenu() {
label: 'Stop all transfers',
click: stopAllTransfers
},
{ type: 'separator' },
{
label: 'Delete all inactive transfers',
click: (menuItem, browserWindow, event) => {
let torrents = webTorrentClient.torrents
console.log(torrents.length)
torrents.forEach((torrent) => {
if (torrent.paused || torrent.done) {
console.log(p, "Exists")
torrent.destroy(() => mainWindow.webContents.send('remove-torrent', torrent.infoHash))
mainWindow.webContents.send('remove-torrent', torrent.infoHash)
}
})
}
},
]
},
{ role: 'editMenu' },
Expand Down Expand Up @@ -299,6 +314,21 @@ function createAppOptionsMenu(point) {
label: 'Stop all transfers',
click: stopAllTransfers
},
{ type: 'separator' },
{
label: 'Delete all inactive transfers',
click: (menuItem, browserWindow, event) => {
let torrents = webTorrentClient.torrents
console.log(torrents.length)
torrents.forEach((torrent) => {
if (torrent.paused || torrent.done) {
console.log(p, "Exists")
torrent.destroy(() => mainWindow.webContents.send('remove-torrent', torrent.infoHash))
mainWindow.webContents.send('remove-torrent', torrent.infoHash)
}
})
}
},
{
type: 'separator'
},
Expand Down

0 comments on commit 52bae1e

Please sign in to comment.