Laharah / deluge-uTorrentImport

cross platform Deluge Plugin for importing torrents from uTorrent
73 stars 13 forks source link

Display that you need to restart the Deluge UI after importing #5

Closed ZimbiX closed 9 years ago

ZimbiX commented 9 years ago

I imported 207 torrents and about half of them were unpaused, even though I had left the "Resume After Adding" option unticked. Admittedly, this could be due to having a status of "Error: Files missing from job. Please recheck" in uTorrent - which happened when I restored the uTorrent data from a previous Windows installation.

ZimbiX commented 9 years ago

Oh lol nope, it all works fine. I just needed to quit and reopen the Deluge UI. When I clicked on one that said it was running I noticed that it quickly refreshed to say Paused. You should add a note to say that you need to restart the Deluge UI once the import is complete.

Laharah commented 9 years ago

Yeah this is actually an issue I was trying to trouble shoot yesterday. Part of the issue is as you saw, the UI hasn't updated the status correctly of each torrent. If you click on them many will update, though often slowly since so much info is being handled for the new torrents. Restarting the UI will do it though.

But the root of the problem is, the torrents were not actually paused, but are re-paused after forcing recheck. The torrents all pause eventually, but some torrents that are missing files even have a chance to start downloading a little before they are re-paused.

Unfortunately, after investigating, there's really nothing I can do about this one. The issue goes all the way down to LibTorrent (the c++ library deluge and qBT use to drive their clients). Lib torrent will not re-check a torrent that's paused. So deluge has a workaround that tells libtorrent to repause the torrent as soon as it gets the notification that the check is done. Unfortunately, if any seeders sent you data before the torrent pauses, it will be added to the download when it comes in, even if the torrent is re-paused at that point.

This is actually made worse in the plugin's case. When adding a large number of torrents, deluge is handling thousands of events, and if you have a fast connection and a really well seeded torrent, by the time deluge can handle the re-pause, there's a good chance that at least some data has been downloaded.

I actually deliberately slowed down the rate that the plugin adds torrents, and I make it pause every 10 torrents to allow deluge to handle these re-pause events. That's why the plugin's log comes in bursts of ≈10 torrents. Going any slower didn't seem have too much more of an effect and would only make the process take longer. Other than that I can't think of anything else I can do to prevent this.

Laharah commented 9 years ago

I'm gonna mark this as closed. The new notification I added advises that you restart the UI, thanks for the suggestion!

ZimbiX commented 9 years ago

Interesting. Thanks for the detailed description!