From 2780127459ef42e8172c05f4d7c0103236e9b9ed Mon Sep 17 00:00:00 2001 From: phillmac Date: Fri, 21 May 2021 20:56:10 +0000 Subject: [PATCH] Fix missing trackerData --- src/scrape-functions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scrape-functions.js b/src/scrape-functions.js index 8d1481f..cda535e 100644 --- a/src/scrape-functions.js +++ b/src/scrape-functions.js @@ -24,7 +24,11 @@ module.exports = function (redisClient, lock, debugVerbose = false) { wasStale = true const trackerResults = await scrapeTrackers(torrent._id, staleTrackers) - torrent.trackerData = Object.assign({}, torrent.trackerData, trackerResults) + if (!trackerData) { + torrent.trackerData = trackerResults + } else { + torrent.trackerData = Object.assign(torrent.trackerData, trackerResults) + } const sucessfullTrackers = Object.keys(trackerResults) const missingTrackers = staleTrackers.filter(t => !sucessfullTrackers.includes(t))