From 35157457c7d1e13e8e98093735a29cf5cd484c90 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 22 Jun 2018 22:56:53 +0300 Subject: [PATCH] fix(replication): fix partitial torrent adding --- src/background/spider.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/background/spider.js b/src/background/spider.js index b5013a9..439219b 100644 --- a/src/background/spider.js +++ b/src/background/spider.js @@ -462,6 +462,13 @@ setInterval(() => { const { filesList } = torrent delete torrent.filesList; + if(!filesList || filesList.length == 0) + { + console.log('skip torrent', torrent.name, '- no filesList') + resolve() + return + } + torrent.id = torrentsId++; mysqlSingle.query("SELECT id FROM torrents WHERE hash = ?", torrent.hash, (err, single) => {