Skip to content

Commit

Permalink
fix(p2p): fix files in db count on new architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Dec 4, 2018
1 parent 25f5e19 commit 073eefe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/background/spider.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ module.exports = function (send, recive, dataDirectory, version, env)
filesId = (await sphinxSingle.query("SELECT MAX(`id`) as mx from files"))[0]
filesId = ((filesId && filesId.mx) || 0) + 1
p2p.info.torrents = (await sphinxSingle.query("SELECT COUNT(*) as cnt from torrents"))[0].cnt
p2p.info.files = (await sphinxSingle.query("SELECT COUNT(*) as cnt from files"))[0].cnt
p2p.info.files = await sphinxSingle.query("SELECT SUM(files) as cnt from torrents")
if(p2p.info.files && p2p.info.files.length > 0)
p2p.info.files = p2p.info.files[0].cnt
else
p2p.info.files = 0
const sphinxSingleAlternative = await single().waitConnection()


Expand Down

0 comments on commit 073eefe

Please sign in to comment.