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 upResuming torrents with file metadata #1330
Closed
Comments
This comment has been minimized.
This comment has been minimized.
|
If you're using Cordova, do you have access to the user's filesystem? If so, you can use the same approach as you'd do in Node.js, which is to re-add the torrent with |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, I don't know if this is the right place to ask this.
I'm trying to develop a mobile client for webtorrent using cordova. So far the only issue I'm running into is resuming seeded torrents after the app is closed.
I've solved this by using file.getBuffer and then stringifying the buffer along with the seeded file's name and mime type and then re-seeding the torrent at startup of the app by creating a new File using the constructor new File(buffer, name[, options]) and using client.seed with the created file.
This technically works but there is an inherent flaw in the process as the stringifyed object is stored in local storage of the device as a JSON file and every time a new file is seeded the JSON file's size increases. So, using this is not very practical and would require deleting the original file from the user's storage to balance the space out which is quite inconvenient.
Since I'm not on node and cordova is basically a browser window wrapped in a mobile app, I cannot seed with file path.
Is there any other way to make this work? I'm a student and I'm not very experienced with javascript, If anyone could point me in the right direction I'd be grateful.
Thanks