Comparing version 12.0.8 to 12.0.9
18
index.js
@@ -295,3 +295,3 @@ const WebTorrent = require('webtorrent') | ||
const folderPath = path.join(this._storage, authorStuff.dir) | ||
const checkTorrent = await this.handleTheData({ id: authorStuff.infohash, num: useTimeout, kind: 'start', res: false }, this.startTorrent(folderPath, { ...authorStuff.desc, destroyStoreOnDestroy: false }), {err: true, cb: null}) | ||
const checkTorrent = testTorrent || await this.handleTheData({ id: authorStuff.infohash, num: useTimeout, kind: 'start', res: false }, this.startTorrent(folderPath, { ...authorStuff.desc, destroyStoreOnDestroy: false }), {err: true, cb: null}) | ||
if(checkTorrent.infoHash !== authorStuff.infohash){ | ||
@@ -311,3 +311,3 @@ this.webtorrent.remove(checkTorrent.infoHash, { destroyStore: false }) | ||
const folderPath = path.join(this._storage, id.infohash) | ||
const checkTorrent = await this.handleTheData({ id: id.infohash, num: useTimeout, kind: 'mid', res: false }, this.midTorrent(id.infohash, { path: folderPath, destroyStoreOnDestroy: false }), { err: true, cb: null}) | ||
const checkTorrent = testTorrent || await this.handleTheData({ id: id.infohash, num: useTimeout, kind: 'mid', res: false }, this.midTorrent(id.infohash, { path: folderPath, destroyStoreOnDestroy: false }), { err: true, cb: null}) | ||
checkTorrent.infohash = checkTorrent.infoHash | ||
@@ -331,3 +331,3 @@ await this.handleTheData({num: 0}, this.db.put(`${this._fixed.load}${this._fixed.infohash}${checkTorrent.infohash}`, {size: checkTorrent.length, length: checkTorrent.files.length, infohash: checkTorrent.infohash, name: checkTorrent.name, dir: checkTorrent.dir}), {err: true, cb: async () => { await this.stopTorrent(checkTorrent.infohash, { destroyStore: false }) }}) | ||
const folderPath = path.join(this._storage, authorStuff.dir) | ||
const checkTorrent = await this.handleTheData({ id: authorStuff.address, num: useTimeout, kind: 'start', res: false }, this.startTorrent(folderPath, { ...authorStuff.desc, destroyStoreOnDestroy: true }), {err: true, cb: null}) | ||
const checkTorrent = testTorrent || await this.handleTheData({ id: authorStuff.address, num: useTimeout, kind: 'start', res: false }, this.startTorrent(folderPath, { ...authorStuff.desc, destroyStoreOnDestroy: true }), {err: true, cb: null}) | ||
if(checkTorrent.infoHash !== authorStuff.infohash){ | ||
@@ -362,3 +362,3 @@ this.webtorrent.remove(checkTorrent.infoHash, { destroyStore: false }) | ||
const checkTorrent = await this.handleTheData({ id: checkProperty.address, num: useTimeout, kind: 'mid', res: false }, this.midTorrent(checkProperty.infohash, { path: dataPath, destroyStoreOnDestroy: false }), { err: true, cb: null }) | ||
const checkTorrent = testTorrent || await this.handleTheData({ id: checkProperty.address, num: useTimeout, kind: 'mid', res: false }, this.midTorrent(checkProperty.infohash, { path: dataPath, destroyStoreOnDestroy: false }), { err: true, cb: null }) | ||
// don't overwrite the torrent's infohash even though they will both be the same | ||
@@ -793,12 +793,14 @@ for (const prop in checkProperty) { | ||
await fs.ensureDir(folderPath) | ||
const arr = [] | ||
for (const info of data) { | ||
const tempPath = path.join(folderPath, info.webkitRelativePath || info.name) | ||
const useName = info.webkitRelativePath || info.name | ||
const tempPath = path.join(folderPath, useName) | ||
await this.handleTheData({ id: tempPath, num: sec, res: false, kind: 'formdata' }, pipelinePromise(Readable.from(info.stream()), fs.createWriteStream(tempPath)), {err: true, cb: null}) | ||
arr.push(path.join(fullPath, useName).replace(/\\/g, "/")) | ||
} | ||
return fullPath | ||
return arr | ||
} | ||
async handleRegData(mainPath, body, fullPath, sec) { | ||
const checkDir = path.dirname(mainPath) | ||
await fs.ensureDir(checkDir) | ||
await fs.ensureDir(path.dirname(mainPath)) | ||
await this.handleTheData({ id: mainPath, num: sec, res: false, kind: 'regdata' }, pipelinePromise(Readable.from(body), fs.createWriteStream(mainPath)), {err: true, cb: null}) | ||
@@ -805,0 +807,0 @@ return fullPath |
{ | ||
"name": "torrentz", | ||
"version": "12.0.8", | ||
"version": "12.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
39266
773