diff --git a/src/app/torrent-page.js b/src/app/torrent-page.js index 9f66cc3..dfbdbe0 100644 --- a/src/app/torrent-page.js +++ b/src/app/torrent-page.js @@ -187,8 +187,8 @@ export default class TorrentPage extends Page { } //this.forceUpdate(); // вызывается через searchingIndicator - // Получаем более новую статистику пира - if((new Date).getTime() - this.torrent.trackersChecked > 10 * 60 * 1000) { + // Получаем более новую статистику пира + if((Date.now() / 1000) - this.torrent.trackersChecked > 10 * 60) { window.torrentSocket.emit('checkTrackers', this.torrent.hash); } } @@ -220,7 +220,7 @@ export default class TorrentPage extends Page { if(!this.torrent) return; - Object.assign(this.torrent, info); + this.torrent = Object.assign(this.torrent, info); this.forceUpdate(); } window.torrentSocket.on('trackerTorrentUpdate', this.trackerUpdate); @@ -358,7 +358,7 @@ export default class TorrentPage extends Page {
- +
+
+ { + this.torrent && this.torrent.info && this.torrent.info.description + ? +
+ : + null + } +
diff --git a/src/background/api.js b/src/background/api.js index a1946b5..9f0c040 100644 --- a/src/background/api.js +++ b/src/background/api.js @@ -25,6 +25,7 @@ module.exports = async ({ setupTorrentRecord, p2pStore, feed, + updateTorrentTrackers, remoteTrackers }) => { let torrentClientHashMap = {} @@ -515,7 +516,9 @@ module.exports = async ({ if(hash.length != 40) return; + logT('tracker', 'recheck trackers for', hash) updateTorrentTrackers(hash); + remoteTrackers.update({hash, name: hash}) }); const topTorrentsCall = (type, navigation = {}, callback) => { diff --git a/src/background/spider.js b/src/background/spider.js index 0486006..a1a60b0 100644 --- a/src/background/spider.js +++ b/src/background/spider.js @@ -116,6 +116,7 @@ module.exports = function (send, recive, dataDirectory, version, env) return logT('tracker', 'found', name, 'on', tracker) + let info; this.sphinx.replaceValues('torrents', {hash, info: data}, { particial: true, key: 'hash', @@ -129,7 +130,14 @@ module.exports = function (send, recive, dataDirectory, version, env) obj.trackers = [] obj.trackers.push(tracker) obj.trackers = [...new Set(obj.trackers)] - } }) + + info = obj + } }).then(() => { + send('trackerTorrentUpdate', { + hash, + info + }); + }) }) } } @@ -151,7 +159,7 @@ module.exports = function (send, recive, dataDirectory, version, env) seeders: row.seeders, completed: row.completed, leechers: row.leechers, - trackersChecked: row.trackersChecked ? row.trackersChecked.getTime() : undefined, + trackersChecked: row.trackerschecked || row.trackersChecked, good: row.good, bad: row.bad, info: typeof row.info == 'string' && row.info.length > 0 ? JSON.parse(row.info) : undefined @@ -781,6 +789,7 @@ module.exports = function (send, recive, dataDirectory, version, env) setupTorrentRecord, p2pStore, feed, + updateTorrentTrackers, remoteTrackers })