Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

explore the files inside the torrent before downloading? #84

Open
MartinMatomo opened this issue Oct 29, 2022 · 6 comments
Open

explore the files inside the torrent before downloading? #84

MartinMatomo opened this issue Oct 29, 2022 · 6 comments

Comments

@MartinMatomo
Copy link

Hi,
I have a torrent that contains several files inside, how to explore these files and choose which one to stream ? As an example, the attached image.
photo_2022-10-29_13-53-07

@se-bastiaan
Copy link
Owner

What have you tried already? There is a function to get the file names of the files in the torrent metadata: https://github.com/TorrentStream/TorrentStream-Android/blob/develop/library/src/main/java/com/github/se_bastiaan/torrentstream/Torrent.java#L254

@MartinMatomo
Copy link
Author

Hi, I managed to display the file names in a custom Listview, but I'm looking for how to launch the download by specifying the index of the selected file ?
I found the line: torrentSession.download(torrentInfo, saveDirectory, null, priorities, null, torrent_flags_t.from_int(0)); in the startStream() method. How to specify the file to download ?

@se-bastiaan
Copy link
Owner

It's the function above the one I linked before..

@MartinMatomo
Copy link
Author

Yes, with the function you linked, I managed to display the file names contained in a torrent file, I have the list of all the file names on a ListView, now I'm looking for how to download only the selected file by returning its index on the ListView

@se-bastiaan
Copy link
Owner

I am pointing you to the same place now. Because what you are looking for is in the same file, about 100 lines above it.

@MartinMatomo
Copy link
Author

Yes, thank you, I had found the solution. Thank you for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants