This commit is contained in:
Diego Rodríguez Baquero
2021-10-10 13:58:19 -05:00
parent 08a182d165
commit 1350f3f7cf
5 changed files with 5 additions and 14 deletions

View File

@@ -156,8 +156,7 @@ module.exports = class TorrentListController {
prioritizeTorrent (infoHash) {
this.state.saved.torrents
.filter(torrent => // We're interested in active torrents only.
['downloading', 'seeding'].indexOf(torrent.status) !== -1)
.filter(torrent => ['downloading', 'seeding'].includes(torrent.status)) // Active torrents only.
.forEach((torrent) => { // Pause all active torrents except the one that started playing.
if (infoHash === torrent.infoHash) return