omaralvarez / deluge-autoremoveplus

Auto removing of deluge torrents
152 stars 61 forks source link

Reannounce to tracker before removing torrent #19

Closed uraid closed 2 years ago

uraid commented 8 years ago

Been using the plugin and noticed that sometimes the tracker isn't fully updated before auto-removing a torrent (e.g. uploaded 500MB but tracker says 450MB). So I added a functionality to pause and resume a torrent before removing it so the tracker will get updated stats. Thought about 'component.get("Core").force_reannounce(torrent_id)', but it doesn't work ok (Next announce is not updated so I think it's somehow broken). The sleep delay is there to give the tracker a chance to be updated, though I think it can be optimized.

omaralvarez commented 8 years ago

Thank you very much for your contribution! As soon as I can, I will review your code and merge it if everything looks good.

I'm not completely sure if the sleep period is optimal, 2 seconds for every torrent that you delete seems really excessive. Imagine deleting 100 torrents this way, it would take too long IMO. Have you tested other times like 0.5s?

Are you sure that the reannounce function is not working. If this is the case, maybe you should open a ticket for this bug in the Deluge project page.

uraid commented 8 years ago

That is my findings with latest deluge stable version. The reannounce doesn't seem to do anything (if no error. If there is an error it works), but confirmation could be good.

As said sleep isn't optimal at all and should be something else imho.

knowskones commented 8 years ago

This is good and I will use it. I can see it being a problem for some configurations though. Eg. On first run when there are a large amount of torrents that are to be deleted. Or if set to only check once a day+ and a large amount of torrents are eligible for deletion.

Though taking 10 minutes to delete a large amount of torrents every now and then is a small price to pay for ensuring torrents aren't getting deleted before getting updated.

I used the plugin previously and set to delete at either 1.1 day or ratio of 1.1. I had like 500 hnr all with ratios of .9 or seed time of 23h.

DirectorX commented 6 years ago

@uraid @omaralvarez I've found that the best way to force trackers update is by changing the trackers (to the same trackers)

see https://github.com/stefantalpalaru/deluge-default-trackers/blob/master/defaulttrackers/core.py#L85