Help implementing patch to stop torrents after x timeseeding

Suggestions and discussion of future versions
Post Reply
pilluli
Member
Member
Posts: 17
Joined: Thu Sep 27, 2007 6:27 am

Help implementing patch to stop torrents after x timeseeding

Post by pilluli »

Hi,

I am going to try to implement a patch to provide the functionality of stopping a torrent after x time seeding. See ticket #976. I am new to deluge code so I need some help from any dev willing to. First of all I have some general questions:

1. Any general tips on where to start looking? deluge-core, libtorrent??

2. Where should the logic of the stopping go (the code actually checking if time seeding is greater than the selected from the user)? Is something that go to the python code in deluge or in the libtorrent one for instance?

I have started taking a look at the code. My idea was to follow the logic of how stopping a torrent at some ratio works and go from there. However:

3. what is the difference between the "stop_ratio" and "stop_at_ratio" options? I guess one is per torrent and the other one general for all but which is which?

Any help will be greatly appreciated. Obviously, if you believe this options is no use at all then please say so!!

Regards,
pilluli
Member
Member
Posts: 17
Joined: Thu Sep 27, 2007 6:27 am

webui

Post by pilluli »

OK,

I think I have found my way through the code. I have everything implemented including changing the gtkui to add the stopseed option. Everything seems to work but some more testing is needed before I can make it public without shame :-)

However, I am finding difficulties adding the options in webui. I have seen that the file "deluge-all.js" is composed of other small files (such as Keys.js). I have modifed the small files but the build process do not seem to update the deluge-all.js file. How can I do that? Do I have to also change deluge-all.js manually??

Any help will be appreciated.

Regards,
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: webui

Post by johnnyg »

pilluli wrote:However, I am finding difficulties adding the options in webui. I have seen that the file "deluge-all.js" is composed of other small files (such as Keys.js). I have modifed the small files but the build process do not seem to update the deluge-all.js file. How can I do that? Do I have to also change deluge-all.js manually??
deluge-all.js is built using yui compressor (see http://git.deluge-torrent.org/deluge/tr ... /web/build).
So you don't need to manually update it.

Instead to test your patch, visit the web ui with ?dev=true at the end (this will make it use the individual files, rather than deluge-all.js).
e.g. http://localhost:8112/?dev=true
pilluli
Member
Member
Posts: 17
Joined: Thu Sep 27, 2007 6:27 am

Re: webui

Post by pilluli »

Instead to test your patch, visit the web ui with ?dev=true at the end (this will make it use the individual files, rather than deluge-all.js).
e.g. http://localhost:8112/?dev=true
Many thanks, I will use this option to test my patch.
deluge-all.js is built using yui compressor (see http://git.deluge-torrent.org/deluge/tr ... /web/build).
So you don't need to manually update it.
Can you point me to any document describing the parameters to call that script? Regards,
pilluli
Member
Member
Posts: 17
Joined: Thu Sep 27, 2007 6:27 am

Re: Help implementing patch to stop torrents after x timesee

Post by pilluli »

Hi,

After some time I managed to create an initial patch to support this functionality. The patch is still a little bit rough but I have been testing it for some weeks now and it works as it stops torrents after some hours seeding (default 24hours). Some considerations in the patch:

1. It is against deluge 1.3.0 (I started it for that version but should not be difficult to convert it to 1.3.1 or trunk)
2. As I didn't find an easy way to install the yui compressor in my machine or execute it (an old 9.04 ubuntu server) the patch modifies the web individual files and "deluge-all.js" files in the webui.
3. Small code to adapt ETA time when "stop seed at after x timeseeding" is set is still missing
4. The timeseeding can be adapted per torrent file in the gtk ui or webui but a general setting is also missing

Just thought that others might find the patch useful so here it is. At least for me, as it is, it is completely usable. Regards,

EDIT: It seems I can not upload any file with extension .patch, .diff, .txt or without to the board so it is here http://paste.ubuntu.com/547423/
Post Reply