fix(core): fix sometimes calc of torrents sizes

This commit is contained in:
Alexey Kasyanchuk
2019-04-02 00:25:37 +01:00
parent df1ebd1e03
commit f255b8770a
2 changed files with 6 additions and 6 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "rats-search",
"version": "1.1.3",
"version": "1.1.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -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
{