-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Torrent completed event before torrent completed #4
Comments
Hi @mirceaciu, Thanks for reporting this. I don't think this behavior should be expected. According to the documentation, https://libtorrent.org/manual.html the torrent_finished_alert should only be emitted once, on download completion:
I suspect the problem is occurring, here. I vaguely recall adding the call to resume in relation to downloads started using magnet links (it's been awhile since I've worked on this library). This might be triggering the finished alert when the torrent is added. I'm glad you were able to find a low cost work-around. I will try to find time to do some research and figure out what's going on sometime over the weekend. If you figure out what's causing it sooner than that, pull requests are always welcome. Are you able to reproduce the issue when using a torrent file? |
Unfortunately my Java/Kotlin skills are limited to basics as I just started using this language so it's unlikely that I will be able to do PR. I will test using torrent files and maybe some other torrent providers (other trackers and stuff). Maybe that will help. |
It seems that this issue occurs for downloads started with both a torrent and a magnet. Without the call call to the resume method both fail to start. I feel like this call to resume on torrent added shouldn't be required and that I'm doing something wrong. I've opened a ticket, here to try to get some insight as to what might be causing this and why downloads aren't starting as expected. |
Hi, i am facing similar issue and when i try to resume a torrent which was partially downloaded earlier, instead of resuming or restarting it just don't do anything however i see method
Please help if there is any workaround for this. |
@sidsaxena0 What you're seeing doesn't seem related to this issue. Are you using a magnet or torrent file to start and resume the download? Do you have your torrent session in a foreground service? Does the demo application included in this repository successfully resume for you? |
@masterwok I am using magnet link for start and resume download and yes demo application of the project is working fine. Even if i kill the app it starts again from the point where it left but not in case of my code. Can you please help? |
@sidsaxena0 onTorrentResume() is called once when a torrent is added to a session or when you resume downloading a torrent after you have paused it. This can help you better: https://libtorrent.org/reference-Core.html#save_resume_data() |
First some context on my setup:
I use OpenTracker (tracker) and Transmission(seeder) as docker containers on an cloud. I upload video files to that cloud and add them as torrents to Transmission which will start seeding. I get a magnet url of that torrent and sent it to my android app that uses this project.
I am using a singleton instance of this torrent module for a React Native bridge(less important)
I implemented the events interface
When I add a new torrent to download the
onAddTorrent
fires.After that I will expect to see some logging from the
onPieceFinished
event then eventually aonTorrentFinished
.What happens is that:
onAddTorrent
fires after torrent is started;onTorrentFinished
fires as soon as Transmissions sees the peer (soon afteronAddTorrent
);onPieceFinished
fire;onTorrentFinished
;On first
onTorrentFinished
file has 0mb. On secondonTorrentFinished
file was properly downloaded and can be played back.To overcome this I had to do a double check in the onTorrentFinished event
Is this expected? Note that I am using magnet torrents.
The text was updated successfully, but these errors were encountered: