Comparing version 12.0.6 to 12.0.7
10
index.js
@@ -231,7 +231,5 @@ const WebTorrent = require('webtorrent') | ||
if (path.extname(pathToData)) { | ||
const checkFile = mainData.files.find(file => { return pathToData === file.urlPath }) | ||
return checkFile ? checkFile : null | ||
return {done: mainData.done, progress: mainData.progress, remain: `${mainData.downloaded} out of ${mainData.length}`, data: mainData.files.find(file => { return pathToData === file.urlPath })} | ||
} else { | ||
const checkFolder = mainData.files.filter(file => { return file.urlPath.startsWith(pathToData) }) | ||
return checkFolder.length ? checkFolder : null | ||
return {done: mainData.done, progress: mainData.progress, remain: `${mainData.downloaded} out of ${mainData.length}`, data: mainData.files.filter(file => { return file.urlPath.startsWith(pathToData) })} | ||
} | ||
@@ -246,5 +244,5 @@ } else { | ||
if (path.extname(pathToData)) { | ||
return torrent.files.find(file => { return pathToData === file.urlPath }) | ||
return {done: torrent.done, progress: torrent.progress, remain: `${torrent.downloaded} out of ${torrent.length}`, data: torrent.files.find(file => { return pathToData === file.urlPath })} | ||
} else { | ||
return torrent.files.filter(file => {return file.urlPath.startsWith(pathToData)}) | ||
return {done: torrent.done, progress: torrent.progress, remain: `${torrent.downloaded} out of ${torrent.length}`, data: torrent.files.filter(file => {return file.urlPath.startsWith(pathToData)})} | ||
} | ||
@@ -251,0 +249,0 @@ } |
{ | ||
"name": "torrentz", | ||
"version": "12.0.6", | ||
"version": "12.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Torrentz | ||
coming soon | ||
# example | ||
``` | ||
const options = {} | ||
const Torrentz = require('torrentz') | ||
const torrentz = new Torrentz(options) | ||
``` | ||
## options | ||
``` | ||
{ | ||
dir: "some/directory/where/all/the/data/is/stored" , // string, optional, default: __dirname | ||
storage: "name-of-storage-directory", // string, optional, default: 'storage' | ||
base: "name-of-database-directory", // string, optional, default: 'base' | ||
routine: 0, // number, optional, default: 3600000 | ||
} | ||
``` |
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
38467
18
768