Plugin vs Preferences priority? (About Move + Ratio plugins)

Suggest, post, or discuss plugins for Deluge
User avatar
Ux64
Seeder
Seeder
Posts: 140
Joined: Wed Nov 14, 2007 5:02 am
Location: System Specialist

Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by Ux64 »

Hi,

It seems to be so that preferences override plugin. It means that some plugins need to be changed or I need to be able to set priority. If plugin or pereferences value is preferred.

In preferences I can set 0 seed ratio. With plugin I can set only 1.0. If I choose 0 seed ratio in preferences and choose 2.0 with plugin, plugin doesn't do anything. Preferences override it. Ratio plugin should support other than preselected ratios.

It also causes a problem, because move complete torrent plugin doesn't clearly have time to move torrent before it's removed from list by preferences.

So Move Torrent should work. And also ratio plugin should work, if any value is set.

Any comments or ideas? I mean if there is some other way to get wanted result without software changes.

- Thanks
yobbobandana
Member
Member
Posts: 10
Joined: Thu Aug 30, 2007 9:57 pm

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by yobbobandana »

I just submitted a patch which should fix the desired ratio plugin.

It's working well on my end now :).

If anyone who knows how could apply my patch and test, I'd be grateful. I changed some of it's default values and added the options for a 0 ratio and unlimited ratio, so I think it's more useful now as well.

http://dev.deluge-torrent.org/attachmen ... format=raw

the patch can be applied to either SVN or 0.5.7.1
User avatar
Ux64
Seeder
Seeder
Posts: 140
Joined: Wed Nov 14, 2007 5:02 am
Location: System Specialist

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by Ux64 »

yobbobandana wrote:I just submitted a patch which should fix the desired ratio plugin.
Great! Thank you!

If you use that in conjunction with move torrent plugin does it work correctly too? Because for me that is more annoying problem than the problem that I can't set desired ratio. Because target ratio requirement quite often it's 0 for free trackers. Move torrent plugin doesn't seem to be working if I set desired ratio to 0 with option in preferences.

I'm sorry that I'm not that advanced Linux / Ubuntu user yet. I tried to use patch, but patch isn't installed. When using Synaptic for some strange reason Ubuntu didn't load it from net, but asked for CD which I don't have right now. Strange. But that's not a topic for this forum.

I'll hope you'll patch will be included in official version soon. I guess I can use patched version after having a nice googling sessoin and fixing my synaptic / patch problem.
Last edited by Ux64 on Mon Dec 03, 2007 5:45 am, edited 2 times in total.
danii
Seeder
Seeder
Posts: 123
Joined: Tue Oct 23, 2007 10:29 pm
Location: Braga, Portugal

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by danii »

just applied the patch, "Desired Ratio" works as expected now, Thank You yobbobandana

i'm running SVN on gentoo, python 2.4.4
markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
Location: Chicago, IL, USA
Contact:

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by markybob »

yobbobandana wrote:I just submitted a patch which should fix the desired ratio plugin.

It's working well on my end now :).

If anyone who knows how could apply my patch and test, I'd be grateful. I changed some of it's default values and added the options for a 0 ratio and unlimited ratio, so I think it's more useful now as well.

http://dev.deluge-torrent.org/attachmen ... format=raw

the patch can be applied to either SVN or 0.5.7.1
0 and unlimited do the same thing, so why have two different settings? also, both of those do the exact same thing as the current "not set" ...so what does your patch actually change besides making the default 0 instead of 1?
yobbobandana
Member
Member
Posts: 10
Joined: Thu Aug 30, 2007 9:57 pm

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by yobbobandana »

@danii thanks :)

@markybob
The way I set it up, "unlimited" will seed forever, whereas "0" will not seed at all. "Default" will use whatever is given in the main deluge preferences.

For example, I have my default ratio set at 1.2, but I'm seeding some of the deluge torrents with "Unlimited" set. So new torrents will stop seeding at 1.2, but the others will stay until I remove them.

The reason I changed the label from "not set", is because it was a bit ambiguous whether it meant "unlimited" or "use deluge default".

There have been a couple times when I've wanted a torrent to pause as soon as it finished downloading, which was why I thought the "0" option might be useful.

I added a couple lines to convert the value for the core.set_ratio() method (which used 0 to mean unlimited I think), but it seemed that the ratio check was done solely in the core.apply_queue() method, and the set_ratio one was ignored anyway.

In any case, I'm not sure that was the best way to set it up, I can mess with it a bit more if you'd like :).


@Ux64
I haven't looked at the move torrent plugin, so the problem is probably still there, sorry!

Applying the patch is pretty easy if you know what you're doing, but the learning curve to get to that point is fairly steep :(. I don't really remember where a good place to start learning would be.
markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
Location: Chicago, IL, USA
Contact:

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by markybob »

yobbobandana wrote:@danii thanks :)

@markybob
The way I set it up, "unlimited" will seed forever, whereas "0" will not seed at all. "Default" will use whatever is given in the main deluge preferences.

For example, I have my default ratio set at 1.2, but I'm seeding some of the deluge torrents with "Unlimited" set. So new torrents will stop seeding at 1.2, but the others will stay until I remove them.

The reason I changed the label from "not set", is because it was a bit ambiguous whether it meant "unlimited" or "use deluge default".

There have been a couple times when I've wanted a torrent to pause as soon as it finished downloading, which was why I thought the "0" option might be useful.

I added a couple lines to convert the value for the core.set_ratio() method (which used 0 to mean unlimited I think), but it seemed that the ratio check was done solely in the core.apply_queue() method, and the set_ratio one was ignored anyway.

In any case, I'm not sure that was the best way to set it up, I can mess with it a bit more if you'd like :).


@Ux64
I haven't looked at the move torrent plugin, so the problem is probably still there, sorry!

Applying the patch is pretty easy if you know what you're doing, but the learning curve to get to that point is fairly steep :(. I don't really remember where a good place to start learning would be.
no. i think you two just misunderstood the entire point of what desired ratio is supposed to do. 0 in desired ratio will mean unlimited no matter what you want it to mean, unless you edit the libtorrent source code. and no again, set_ratio was not ignored. the desired ratio isnt meant to be a hard limit at all...this is why it's different than the seeding preferences in the main client. here's the libtorrent manual section that is used by desired ratio http://libtorrent.svn.sourceforge.net/v ... #set-ratio
"set_ratio() sets the desired download / upload ratio. If set to 0, it is considered being infinite. i.e. the client will always upload as much as it can, no matter how much it gets back in return. With this setting it will work much like the standard clients.
Besides 0, the ratio can be set to any number greater than or equal to 1. It means how much to attempt to upload in return for each download. e.g. if set to 2, the client will try to upload 2 bytes for every byte received. The default setting for this is 0, which will make it work as a standard client."
User avatar
Ux64
Seeder
Seeder
Posts: 140
Joined: Wed Nov 14, 2007 5:02 am
Location: System Specialist

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by Ux64 »

Zero ratio
I think that there is quite big difference between infinite and zero ;) If it's hard to imagine it, think it as your bank account. Do you have zero cash or infinite funds?

I personally hate programs that doesn't support clear values or options. Zero is not infinitely large number, or is it? Ask you math teacher. I have been for long time nagging about one (other!) program UI which supports only totally idiotic search. You can choose from pick list to pick value from 0-10. If I choose zero, it lists all entries. If I choose 1 it lists entries with value 1 etc. But how do I look for entries that doesn't have value of 1-10 then? I want to list entries which got zero value. There is no way doing that. I wonder who wrote that crappy search routine. ;) So I can list entries with all other values, but I can't list zero value, because zero equals every value. Phew, major logic error! Could you think about array where you couldn't address first entry of it at all? Because pointing to it would mean addressing all entries? After all this is so common mistake that I sometimes wonder how it can exist at all.

Of course if ratio zero is same as unlimited, you could have near zero value. Like 1/1000000? ;) It's a moronic way to get around that problem, but it would practically lead to same result.

Sample, I used Evolutions search to look for messages without subject. Guess what? Empty means same thing as anything. If I choose to list messages with subject field it lists all messages. If I list messages that doesn't have empty subject field I got zero hits even I have messages without subject field. Yet another perfect example of this problem.

Patching
I got patching (technically) to work and did read a few patching tutorials.

Code: Select all

:/usr/share/deluge/plugins/DesiredRatio$ sudo patch __init__.py desired_ratio.diff 
patching file __init__.py
Hunk #1 FAILED at 168.
Hunk #2 FAILED at 576.
Hunk #3 FAILED at 589.
3 out of 3 hunks FAILED -- saving rejects to file __init__.py.rej
patching file __init__.py
Because patching didn't go perfectly I restored original version. Maybe I don't have right version of __init__.py? Or maybe I applied it to totally wrong file?

And finally. Markybob, don't get upset, especially about what I write. I know my style is annoying and I have been working so long with software development that I'm sick'n'tired and totally fedup of about some things. Most probably I really should consider changing my career and become florist or something. That's why I don't bother often explaining things completely. I get too much stress about bugs and design flaws etc at work already. So let me know, if I really annoy you I will gladly shut up if it lets you to do better work with deluge. I really like it, if I wouldn't like it... I naturally wouldn't bother to write about these problems and look for solutions that hopefully benefit all of us.

- Thank you
Last edited by Ux64 on Mon Dec 03, 2007 3:46 pm, edited 6 times in total.
markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
Location: Chicago, IL, USA
Contact:

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by markybob »

Ux64 wrote:I think that there is quite big difference between infinite and zero ;) If it's hard to imagine it, think it as your bank account. Do you have zero cash or infinite funds?

I got patching to work and did read a few patching tutorials.

Code: Select all

:/usr/share/deluge/plugins/DesiredRatio$ sudo patch __init__.py desired_ratio.diff 
patching file __init__.py
Hunk #1 FAILED at 168.
Hunk #2 FAILED at 576.
Hunk #3 FAILED at 589.
3 out of 3 hunks FAILED -- saving rejects to file __init__.py.rej
patching file __init__.py
Because patching didn't go perfectly I restored original version. Maybe I don't have right version of __init__.py? Or maybe I applied it to wrong file?

I personally hate programs that doesn't support clear values. Zero is not infinitely large number. I have been for long time nagging one program about it's idiotic search. You can choose from pick list to pick entries that have value from 0-10. If I choose zero, it lists all entries. But how do I look for entries that doesn't have value of 1-10 then? There is no way. I wonder who wrote that crappy search routine. ;) So I can list entries with all other values, but I can't list zero value, because zero equals every value. Phew, major logic error! Could you think about array where you couldn't address first entry of it at all, because zero means all entries?
it's 0 in the code, not on the GUI end. there's a big difference between the two. this is why there's only 1-3 or not set in the desired ratio gui. which is why it's utterly worthless to add a 0 to it, since in the backend 0 means infinite, which is my point. sigh. i quit
User avatar
Ux64
Seeder
Seeder
Posts: 140
Joined: Wed Nov 14, 2007 5:02 am
Location: System Specialist

Re: Plugin vs Preferences priority? (About Move + Ratio plugins)

Post by Ux64 »

markybob wrote:it's 0 in the code, not on the GUI end. there's a big difference between the two. this is why there's only 1-3 or not set in the desired ratio gui. which is why it's utterly worthless to add a 0 to it, since in the backend 0 means infinite, which is my point. sigh. i quit
After thinking a good while. Let me rephrase my point. I have to say that I totally agree with you. And I clearly see your technical point. I have quite often these discussions, when technical view point is different or very different from user needs. And surprisingly these things are related to usability. Technically working doesn't always use that it's practically working.

I'm also (unfortunately) famous about making totally horrible kludge and hack on solutions to get functionality what customer/end user needs with small changes to program code without making a proper solution.

Source of this problem is that the backend uses 0 to mean infinite ratio. It should use -1 (which is otherwise impossible value) or separate flag "no target ratio" to mean infinite.

I also have to admit that my (horrible kludge) suggestion of using 0.0000001 as ~0 value doesn't work in all cases at all, even it would work in most of normal cases with public trackers or so. But in following case it wouldn't work.

Let's say I have only two peers. Seed is uploading and peer is downloading.

In that case uploaders ratio is divizion by zero. Which in math terms isn't infinite value, but in this case it's same thing. So let's say that it is.

And downloaders ratio is nice round zero. When downloader has finished downloading, ratio is still zero. If target ratio is larger than zero (~0) it won't meet this criteria.

In this case I think there would be a need for truly zero target ratio which would then meet this criteria.

Now I think we understand each other.

My lousy suggestion how to get around this problem is writing some more plugin code.

Plugin should store flag "no seeding", "zero ratio", "remove when complete" or what ever we would like to call it when "zero" seeding value is selected / torrent. Also there could be flag "seed forever", "infinite ratio" or what ever. It would mean that seeding will continue unless aborted by some other mean. And I think these options should be selectable / torrent.

If torrent with that "flag" set is complete (seeding) it should match it regardless of ratio. What ever post processing is defined. Pause, Move, Clear etc.

Actually this could also solve my problem with move torrent which I was talking about in first post of this thread. Because now move torrent plugin doesn't move complete torrents because of the options that I have set in preferences "stop seeding torrents when their share ratio reaches: 0.00" and "automatically clear torrents that reach the max share ratio" clears it from Deluge.

Btw. There 0.00 works fine. ;)

- Thank you!
Last edited by Ux64 on Tue Dec 04, 2007 7:26 am, edited 1 time in total.
Post Reply