dot-torrent
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -167,9 +167,9 @@ "use strict"; | ||
const torrentInfo = TorrentParser._info(decodedData); | ||
const pieceLength = TorrentParser._pieceLength(decodedData); | ||
if (!torrentInfo || !pieceLength || !Buffer.isBuffer(torrentInfo.pieces)) { | ||
if (!torrentInfo || !Buffer.isBuffer(torrentInfo.pieces)) { | ||
return []; | ||
} | ||
// console.log(torrentInfo.pieces.length, torrentInfo.pieces[0], pieceLength); | ||
const pieces = []; | ||
for (let i = 0; i < torrentInfo.pieces.length; i += pieceLength) { | ||
pieces.push(torrentInfo.pieces.subarray(i, i + pieceLength)); | ||
for (let i = 0; i < torrentInfo.pieces.length; i += 20) { | ||
pieces.push(torrentInfo.pieces.subarray(i, i + 20)); | ||
} | ||
@@ -176,0 +176,0 @@ return pieces; |
{ | ||
"name": "dot-torrent", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Parse and create torrent files", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
34689