Comparing version 2.0.8 to 2.0.9
23
index.js
@@ -69,2 +69,15 @@ const WebTorrent = require('webtorrent') | ||
const dir = await fs.readdir(this._author) | ||
for (const torrent of this.webtorrent.torrents) { | ||
if (torrent.address) { | ||
if(dir.includes(torrent.address)){ | ||
dir.splice(dir.indexOf(torrent.address), 1) | ||
} | ||
try { | ||
await this.saveData(torrent) | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
await new Promise((resolve, reject) => setTimeout(resolve, 4000)) | ||
} | ||
} | ||
for(const data of dir){ | ||
@@ -80,12 +93,2 @@ const useData = await fs.readFile(path.join(this._author, data)) | ||
} | ||
for (const torrent of this.webtorrent.torrents) { | ||
if (torrent.address && !torrent.own) { | ||
try { | ||
await this.saveData(torrent) | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
await new Promise((resolve, reject) => setTimeout(resolve, 4000)) | ||
} | ||
} | ||
this._readyToGo = true | ||
@@ -92,0 +95,0 @@ } |
{ | ||
"name": "torrentz", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26134
616