index23 / chunk-store-idb

IndexedDB chunk store that is abstract-chunk-store compatible
MIT License
1 stars 0 forks source link

Usage with WebTorrent #7

Open jackhadrill opened 3 years ago

jackhadrill commented 3 years ago

Apologies for using a GitHub issue to reach out to you.

I was just wondering whether you'd tried or had any success using this alongside WebTorrent? It is my understanding that WebTorrent accepts an abstract chunk store compliant object to download data to.

client.add(torrentId, { store: ChunkStoreIdb }, torrent => {})

Looks like it's working in Firefox (although nothing appearing in the dev tools under IndexedDB) but isn't working in Chrome. Let me know if there's anything I can do to help!

index23 commented 3 years ago

Hi @jackhadrill, this library is not entirely finished. I didn't setup library module type. You can import library in following way:

let ChunkStoreIdb = require('chunk-store-idb');

and use in webtorrent:

client.add(torrentId, { store: ChunkStoreIdb.Store }, torrent => {});

And it should work fine.

But this solution is not final, it would be changed. I can inform you after I finish library.