Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

torrentz

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

torrentz - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

41

index.js

@@ -178,3 +178,3 @@ const WebTorrent = require('webtorrent')

} else {
seq = count === null ? 0 : count
seq = count ? count : 0
}

@@ -329,6 +329,6 @@

}
async publishTorrent(update, id, count, headers, data, checkTimeout = 0, empty = null){
async publishTorrent(gen, id, count, headers, data, checkTimeout = 0, empty = null){
const useTimeout = checkTimeout ? checkTimeout : this._timeout
if(update){
if (!id || !id.address || !id.secret) {
if(gen){
if (!id.address || !id.secret) {
id = this.createKeypair()

@@ -399,25 +399,6 @@ } else {

if(id.sub){
if(this.checkId.has(id.sub)){
this.checkId.delete(id.sub)
}
const subTorrent = this.findTheTorrent(id.sub)
if(subTorrent){
await new Promise((resolve, reject) => {
this.webtorrent.remove(subTorrent.infoHash, {destroyStore: false}, error => {
if(error){
reject(error)
} else {
resolve()
}
})
})
}
await fs.remove(path.join(this._storage, id.sub))
if(this.checkId.has(id)){
this.checkId.delete(id)
}
if(this.checkId.has(id.title)){
this.checkId.delete(id.title)
}
const activeTorrent = this.findTheTorrent(id.title)
const activeTorrent = this.findTheTorrent(id)
if(activeTorrent){

@@ -434,4 +415,4 @@ await new Promise((resolve, reject) => {

}
const folderPath = path.join(this._storage, id.title)
const authorPath = path.join(this._author, id.title)
const folderPath = path.join(this._storage, id)
const authorPath = path.join(this._author, id)
if(empty){

@@ -465,3 +446,3 @@ await fs.emptyDir(folderPath)

checkTorrent.folder = folderPath
checkTorrent.title = id.title
checkTorrent.title = id
checkTorrent.address = null

@@ -472,3 +453,3 @@ checkTorrent.own = true

await fs.writeFile(authorPath, checkTorrent.infohash)
this.checkId.set(id.title, checkTorrent)
this.checkId.set(id, checkTorrent)
return { torrent: checkTorrent, infohash: checkTorrent.infohash, title: checkTorrent.title }

@@ -475,0 +456,0 @@ }

{
"name": "torrentz",
"version": "2.0.1",
"version": "2.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc