Comparing version 5.0.8 to 5.0.9
28
index.js
@@ -837,5 +837,29 @@ const WebTorrent = require('webtorrent') | ||
} | ||
async listDirectory(){ | ||
return await fs.readdir(this._storage, {withFileTypes: true}) | ||
async listDirectory(data){ | ||
return await fs.readdir(this._storage, {withFileTypes: data}) | ||
} | ||
async listAuthor(data){ | ||
if(data){ | ||
const listFiles = await fs.readdir(this._author, {withFileTypes: false}) | ||
const parseFiles = [] | ||
for(const test of listFiles){ | ||
const parseTest = JSON.parse((await fs.readFile(path.join(this._author, test))).toString()) | ||
if(parseTest.address){ | ||
parseTest.id = parseTest.address | ||
parseTest.link = `bt://${parseTest.address}/` | ||
} else if(parseTest.title){ | ||
parseTest.id = parseTest.title | ||
parseTest.link = `bt://${parseTest.infohash}/` | ||
} | ||
parseFiles.push(parseTest) | ||
} | ||
return parseFiles | ||
} else { | ||
const listFiles = await fs.readdir(this._author, {withFileTypes: false}) | ||
return listFiles.map((data) => {return {id: data, link: `bt://${data}/`}}) | ||
} | ||
} | ||
async getAuthorOnly(){ | ||
return await fs.readdir(this._author, {withFileTypes: false}) | ||
} | ||
} | ||
@@ -842,0 +866,0 @@ |
{ | ||
"name": "torrentz", | ||
"version": "5.0.8", | ||
"version": "5.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
37683
779
2