Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd local file deletion on `torrent.destroy` #1102
Conversation
When we call `torrent.destroy` and we are not running in a browser, we use `rimraf` to delete the folder containing the torrent files.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the PR, @Rowern! I think the right way to handle this is to call the I haven't looked, but I suspect that we're only calling You're right that we also want to keep the option to destroy the torrent without destroying the files on disk, so that probably should be an option to |
This comment has been minimized.
This comment has been minimized.
|
You are right, I will continue to work on this PR tomorrow. |
Add an optional `opts` to `client.remove` and `torrent.remove`, if this `opts` set `remove` to `true`, then we call `store.destroy` instead of `store.close`.
|
|
||
| client.remove(torrent, {'remove': true}, function (err) { | ||
| t.error(err, 'torrent removed') | ||
| fs.stat(completeFileName, function (err) { |
This comment has been minimized.
This comment has been minimized.
Rowern
Apr 14, 2017
Author
I know this might not work well with browser API, I might add a check on the type of store used.
This comment has been minimized.
This comment has been minimized.
|
Sorry for closing/re-opening but it was the only way to re-trigger a travis build. |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Aug 2, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Rowern commentedApr 13, 2017
When we call
torrent.destroyand we are not running in a browser, we userimrafto delete the folder containing the torrent files.This is a work in progress because I need feedback on a good way to implement it.
For instance,
client.destroycallstorrent.destroyon all its torrents, this might be problematic as destroying the client looks like the legitimate way of stopping every torrent transactions but keeping your progress.