From 72828b860f778ff85adeae80bb5418b57b07438a Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Wed, 27 Jun 2018 23:49:41 +0300 Subject: [PATCH] fix(replication): fix replication on some cases of downloading --- src/background/api.js | 3 ++- src/background/spider.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/background/api.js b/src/background/api.js index 4600083..b0b1eec 100644 --- a/src/background/api.js +++ b/src/background/api.js @@ -136,6 +136,7 @@ module.exports = async ({ const peer = p2p.find(options.peer) if(!peer) { + console.log('dont found requested peer in peers') callback(undefined) return; } @@ -532,7 +533,7 @@ module.exports = async ({ const peer = { address: socket.remoteAddress, port: socket.remotePort } remote = remote.map(torrent => Object.assign(torrent, {peer})) } - send('remoteTopTorrents', {torrents: remote, type, time: navigation && navigation.time}) + send('remoteTopTorrents', {torrents: mergeTorrentsWithDownloads(remote), type, time: navigation && navigation.time}) }) })); diff --git a/src/background/spider.js b/src/background/spider.js index 406a4e5..0af7c85 100644 --- a/src/background/spider.js +++ b/src/background/spider.js @@ -456,6 +456,10 @@ setInterval(() => { delete torrent.contenttype; } + // clean download info if added + if(torrent.download) + delete torrent.download + if(!checkTorrent(torrent)) { resolve()