webtorrent / webtorrent-cli

WebTorrent, the streaming torrent client. For the command line.
https://webtorrent.io
MIT License
1.18k stars 135 forks source link

refactor: add torrents to a single `WebTorrent` #240

Closed br3ndonland closed 1 year ago

br3ndonland commented 2 years ago

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [ ] Bug fix [x] New feature [ ] Other, please explain:

What changes did you make? (Give an overview)

This is a step toward displaying multiple torrents (#224).

Currently, multiple torrents are handled by setting up separate WebTorrent instances for each torrent.

https://github.com/webtorrent/webtorrent-cli/blob/7e822d8352532529b6fbb6e0c7ed7f6000d0c634/bin/cmd.js#L841

https://github.com/webtorrent/webtorrent-cli/blob/7e822d8352532529b6fbb6e0c7ed7f6000d0c634/bin/cmd.js#L279-L290

It might be easier to manage the console output (and more resource-efficient) to add multiple torrents to a single WebTorrent instance.

This PR will update the runDownload and runDownloadMeta functions to accept multiple torrents and add the torrents to a single WebTorrent instance. Torrent instances will then be available on client.torrents.

Which issue (if any) does this pull request address?

224

Is there anything you'd like reviewers to focus on?

The diff looks big, but it's mostly indentation changes.

I would welcome suggestions for any additional tests that could help.

welcome[bot] commented 2 years ago

🙌 Thanks for opening this pull request! You're awesome.

DiegoRBaquero commented 2 years ago

Can you please rebase your branch

br3ndonland commented 2 years ago

sure no problem

CONTRIBUTING.md says "No --force pushes" or modifying the Git history in any way," but if it's okay with you, it's okay with me.

DiegoRBaquero commented 2 years ago

That's for main/master branch, so it's fine in PRs

github-actions[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

br3ndonland commented 2 years ago

@github-actions[bot] yes it is still relevant

github-actions[bot] commented 1 year ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

br3ndonland commented 1 year ago

@github-actions[bot] yes it is still relevant

github-actions[bot] commented 1 year ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?