From f255b8770a78ec765755fb3ebdc092e4b531b54d Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Tue, 2 Apr 2019 00:25:37 +0100 Subject: [PATCH] fix(core): fix sometimes calc of torrents sizes --- package-lock.json | 2 +- src/background/spider.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index bcd704d..da2429f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rats-search", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/background/spider.js b/src/background/spider.js index 92f3378..11bc724 100644 --- a/src/background/spider.js +++ b/src/background/spider.js @@ -123,9 +123,9 @@ module.exports = function (send, recive, dataDirectory, version, env) { torrentsInfo = torrentsInfo[0] torrentsId = (torrentsInfo.maxid || 0) + 1 - p2p.info.torrents = torrentsInfo.torrentscount || 0 - p2p.info.files = torrentsInfo.numfiles || 0 - p2p.info.filesSize = torrentsInfo.filessize || 0 + p2p.info.torrents = Number(torrentsInfo.torrentscount) || 0 + p2p.info.files = Number(torrentsInfo.numfiles) || 0 + p2p.info.filesSize = Number(torrentsInfo.filessize) || 0 } else { @@ -643,8 +643,8 @@ module.exports = function (send, recive, dataDirectory, version, env) updateTorrentTrackers(torrent.hash); remoteTrackers.update(torrent) p2p.info.torrents++; - p2p.info.files += torrent.files; - p2p.info.filesSize += torrent.size; + p2p.info.files += Number(torrent.files); + p2p.info.filesSize += Number(torrent.size); } else {