diff --git a/client.js b/client.js index 48f0dfb..6fc2179 100644 --- a/client.js +++ b/client.js @@ -281,8 +281,8 @@ Client.scrape = (opts, cb) => { opts.infoHash = Array.isArray(opts.infoHash) ? opts.infoHash.map(infoHash => { - return Buffer.from(infoHash, 'hex') - }) + return Buffer.from(infoHash, 'hex') + }) : Buffer.from(opts.infoHash, 'hex') client.scrape({ infoHash: opts.infoHash }) return client diff --git a/lib/client/http-tracker.js b/lib/client/http-tracker.js index 5f14a37..bacc4eb 100644 --- a/lib/client/http-tracker.js +++ b/lib/client/http-tracker.js @@ -63,8 +63,8 @@ class HTTPTracker extends Tracker { const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0) ? opts.infoHash.map(infoHash => { - return infoHash.toString('binary') - }) + return infoHash.toString('binary') + }) : (opts.infoHash && opts.infoHash.toString('binary')) || this.client._infoHashBinary const params = { info_hash: infoHashes diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index fec33d2..a82f5a6 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -77,8 +77,8 @@ class WebSocketTracker extends Tracker { const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0) ? opts.infoHash.map(infoHash => { - return infoHash.toString('binary') - }) + return infoHash.toString('binary') + }) : (opts.infoHash && opts.infoHash.toString('binary')) || this.client._infoHashBinary const params = { action: 'scrape',