-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(webtorrent): Allow duplicate torrents to be on the page.
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"start": "budo dist.js:bundle.js", | ||
"precommit": "npm test", | ||
"prepush": "npm test", | ||
"prepublish": "mkdir -p dist && browserify dist.js > dist/webtorrent-element.js && cat dist/webtorrent-element.js | minify > dist/webtorrent-element.min.js", | ||
"prepublishOnly": "distjs", | ||
"commitmsg": "validate-commit-msg", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
|
@@ -18,17 +18,25 @@ | |
"dist" | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"keywords": [], | ||
"author": "Mikeal Rogers <[email protected]> (http://www.mikealrogers.com)", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"distjs": "^1.0.0", | ||
"magnet-uri": "^5.1.7", | ||
"webtorrent": "^0.98.19", | ||
"zcomponent": "^1.0.4" | ||
}, | ||
"devDependencies": { | ||
"babel-minify": "^0.2.0", | ||
"browserify": "^14.4.0", | ||
"budo": "^10.0.4", | ||
"cz-conventional-changelog": "^2.0.0", | ||
"husky": "^0.14.3", | ||
"load-js": "^2.0.0", | ||
"standard": "^10.0.3", | ||
|
@@ -38,4 +46,4 @@ | |
"type": "git", | ||
"url": "https://github.com/mikeal/webtorrent-component.git" | ||
} | ||
} | ||
} |
8187c4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a
client.get()
method that essentially does what your method does. Returns the torrent if it already exists in the client, ornull
if it does not.8187c4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feross how does it define a match?
If the magnet URL has additional trackers on it, does it add them?
8187c4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeal It defines a match as having the same
infoHash
and ignores other differences. It's a getter method, so it doesn't make any changes. There currently isn't a way to add a new tracker once a torrent has already been added to the client.