Giter Site home page Giter Site logo

Comments (7)

masterwok avatar masterwok commented on May 24, 2024 1

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:

torrent_finished_alert
This alert is generated when a torrent switches from being a downloader to a seed. It will only be generated once per torrent. It contains a torrent_handle to the torrent in question.

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?

from simple-torrent-android.

mirceaciu avatar mirceaciu commented on May 24, 2024

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.

from simple-torrent-android.

masterwok avatar masterwok commented on May 24, 2024

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.

from simple-torrent-android.

sidsaxena0 avatar sidsaxena0 commented on May 24, 2024

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 onTorrentResumed method is getting called. Is this happening because of this issue or i am doing something wrong.
I just start torrent normally but it won't work.

  torrentSession
                    .get()
                    ?.start(ExoApplication.getContext(), magnetUri)

Please help if there is any workaround for this.

from simple-torrent-android.

masterwok avatar masterwok commented on May 24, 2024

@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?

from simple-torrent-android.

sidsaxena0 avatar sidsaxena0 commented on May 24, 2024

@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?

from simple-torrent-android.

 avatar commented on May 24, 2024

@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()

from simple-torrent-android.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.