Permalink
Browse files

fix seeding torrents when missing from tracker

  • Loading branch information...
mmckegg committed Nov 11, 2016
1 parent ce8c9a2 commit 9b6504b5a3689581830a28e0222b36116ef6b7b2
Showing with 1 addition and 1 deletion.
  1. +1 −1 background-window.js
View
@@ -330,7 +330,7 @@ module.exports = function (client, config) {
// seed rarest torrents first
getTorrentInfo(localTorrents, (err, info) => {
if (err) return console.log(err)
localTorrents.map(infoHash => [infoHash, info[infoHash].complete]).sort((a, b) => {
localTorrents.map(infoHash => [infoHash, info[infoHash] && info[infoHash].complete || 0]).sort((a, b) => {
return (a[1] + Math.random()) - (b[1] + Math.random())
}).slice(0, maxSeed).forEach((item) => {
watchTorrent(item[0])

0 comments on commit 9b6504b

Please sign in to comment.