Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoRBaquero committed Dec 11, 2018
2 parents 5c120ec + c32790d commit 2f844aa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
1 change: 0 additions & 1 deletion AUTHORS.md
Expand Up @@ -133,7 +133,6 @@
- Kaylee (34007889+KayleePop@users.noreply.github.com)
- Brad Marsden (silentbot1@gmail.com)
- lovefoodcode (38153617+lovefoodcode@users.noreply.github.com)
- Gabriel Almeida (gabrieel@email.com)
- filesfm (41144556+filesfm@users.noreply.github.com)
- John Hiesey (john@hiesey.com)
- KayleePop (34007889+KayleePop@users.noreply.github.com)
Expand Down
2 changes: 0 additions & 2 deletions docs/faq.md
Expand Up @@ -105,7 +105,6 @@ WebTorrent is still pretty new, but it's already being used in cool ways:
- **[Bitlove.org][bitlove]** - Your favorite podcasts via BitTorrent
- **[lofiTorrent][lofitorrent]** - Online and offline browser torrent client
- **[Live-torrent][live-torrent]** - Simple implementation of a webtorrent powered live streaming solution ([source code][live-torrent-source])
- **[WWT][wwt]** - Watch videos by torrents in your browser
- **[CDNBye][CDNBye]** - CDNBye implements WebRTC datachannel to scale live/vod video streaming by peer-to-peer network using bittorrent-like protocol.
- **[Files.fm][Files.fm]** - a fast file sharing and freemium cloud storage service that uses P2P technology to accelerate unlimited downloads and file distribution.
- **[imgest][imgest]** - Serverless shareable image gallery built with JavaScript and WebTorrent.
Expand Down Expand Up @@ -192,7 +191,6 @@ There's also a list of WebTorrent-powered alternatives to centralized services h
[lofitorrent]: https://lofitorrent.js.org/
[live-torrent]: https://live.computer
[live-torrent-source]: https://github.com/pldubouilh/live-torrent
[wwt]: https://tnoevry.github.io/wwt/
[CDNBye]: https://github.com/cdnbye/hlsjs-p2p-engine
[Files.fm]: https://files.fm
[imgest]: https://imgest.hashbase.io
Expand Down
9 changes: 8 additions & 1 deletion index.js
Expand Up @@ -257,13 +257,20 @@ class WebTorrent extends EventEmitter {
this._debug('seed')
opts = opts ? Object.assign({}, opts) : {}

// no need to verify the hashes we create
opts.skipVerify = true

const isFilePath = typeof input === 'string'

// When seeding from fs path, initialize store from that path to avoid a copy
if (typeof input === 'string') opts.path = path.dirname(input)
if (isFilePath) opts.path = path.dirname(input)
if (!opts.createdBy) opts.createdBy = `WebTorrent/${VERSION_STR}`

const onTorrent = torrent => {
const tasks = [
cb => {
// when a filesystem path is specified, files are already in the FS store
if (isFilePath) return cb()
torrent.load(streams, cb)
}
]
Expand Down
12 changes: 11 additions & 1 deletion lib/torrent.js
Expand Up @@ -1138,7 +1138,17 @@ class Torrent extends EventEmitter {
const ite = randomIterate(this.wires)
let wire
while ((wire = ite())) {
this._updateWire(wire)
this._updateWireWrapper(wire)
}
}

_updateWireWrapper (wire) {
const self = this

if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function') {
window.requestIdleCallback(function () { self._updateWire(wire) })
} else {
self._updateWire(wire)
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -74,7 +74,7 @@
"brfs": "^2.0.0",
"browserify": "^16.2.3",
"cross-spawn": "^6.0.3",
"electron": "^2.0.0",
"electron": "^3.0.2",
"finalhandler": "^1.0.0",
"network-address": "^1.1.0",
"run-series": "^1.1.4",
Expand Down

0 comments on commit 2f844aa

Please sign in to comment.