Closed 4gus71n closed 7 years ago
Torrent#setSelectedFileIndex(int)
sets all files in the torrent to the IGNORE
priority, which means that the currently downloading file is paused and the new index identifies the file that should be downloaded now. However, I do not really know what the behaviour will be like. The library was specifically built to do single file sequential downloading, but I can imagine that it would work.
If you really want to download files then it might be better to directly use jlibtorrent. Or you could use TorrentStream and use Torrent#getTorrentHandle
to get the underlaying TorrentHandle
to directly modify the file and piece priorities.
Oh I imagine that It will be something like that. I'm gonna to take a shot at Torrent#getTorrentHandle()
. Thank you very much for the quick response!
Hi,
Quick question here, I was wondering if I can select more than one file to download per torrent? For example I have something like this:
mTorrentStreamCache.getDownloadTorrent(abcTorrent)
is a TorrentStream memory cache. It returns an existing TorrentStream if It's already being streamed or returns a new TorrentStream if this is the first time that we call it.Once that we get the TorrentStream we start the download, if its a new TorrentStream we're gonna call
torrentStream.startStream(abcTorrent.getMagneticLink());
that will trigger the TorrenListener#onStreamPrepared(Torrent) method, where we set the file index. If the TorrentStream was already initiallited I just se the file index and start the download.If I want to download the first and third file from a torrent that contains six files, how can I set that? Calling Torrent#setSelectedFileIndex(int) unselects the previous selected file?