extratio Problem

lisas4567

Member
May 25, 2018
773
0
16
I'm using the latest svn of rutorrent and of the utilized plugins (2023) and 0.8.6/0.12.6 of rtorrent/libtorrent.
I'm having a problem with the extratio plugin. I'm trying to get it to apply a ratio group based on label.

Here are my ratios


Here are my ratio rules


I have the autotools plugin installed and I'm utilizing the autolabel feature. Here is the setup:



So I dropped a torrent into /torrent/watch/tv/sickbeard and it started downloading and automatically added the label tv/sickbeard like it should. But the ratio group did not get set to sickbeard, it stayed at the default doubleUp.



I tested adding a file manually through the web gui and assigning a label of tv/sickbeard and that time the ratio group is set correctly to sickbeard.
Any ideas as to why the ratio group isn't being assigned when the label is applied through the auto label feature?
 

lisas4567

Member
May 25, 2018
773
0
16
I've tried to eliminate as many variables as possible to see if I could find the problem.
I disabled all the plugins except: autotools throttle ratio extratio, and I'm using the latest svn of rutorrent and these 4 plugins (2025).

I set the Ratio Rules "Torrent Label contains" variable to just "sickbeard". After I got all these settings in place I rebooted the whole machine (which is Ubuntu Server 10.04 fully updated by the way).

I started rtorrent and launched rutorrent in a browser. First I tried adding a torrent through the web gui and manually giving it a label of tv/sickbeard. After I added the torrent, the correct ratio group of sickbeard was applied as expected.

Then I tried dropping a torrent into /torrent/watch/tv/sickbeard. The torrent was added successfully with the label tv/sickbeard automatically applied as expected. However the ratio group sickbeard was not applied and it had the default ratio group of doubleUp even though the label was exactly the same as the one before.


Both torrents have the exact same label. The top one was added manually and has the right ratio group. The bottom one was added with a watch directory and given a label automatically with autotools and it's ratio group is wrong.

I'm starting to think this may be a bug. Any ideas?
 

peshua19

Member
May 25, 2018
897
0
16
I've been trying to troubleshoot this problem and I've made a couple discoveries that might help in fixing this problem.

In rules.php on line 53 is where it checks to see if the pattern set up in Ratio Rules is found in the label assigned to the torrent. I decided to print out the $label and $this->pattern variables to see what the actually were at this point.

I set the patten in Ratio Rules to tv/sickbeard and added a torrent manually with the label tv/sickbeard. This is the output of the variables:
Label: tv%252Fsickbeard
Pattern: tv/sickbeard

Apparently the label is url encoded and the pattern is not when the comparison takes place. So I changed line 53 to:

$ret = !is_null($label) && ((stripos( rawurldecode(rawurldecode($label)), $this->pattern )!==false) || (($label==='') && ($this->pattern==='')));

adding 2 rawurldecode calls on the label to get it to match the pattern. After I did that this is the output I got from a manually added torrent:
Label: tv/sickbeard
Pattern: tv/sickbeard

Then I tried to add a torrent with the watch folder and this is the output I got:
Label:
Pattern: tv/sickbeard

So the Label is empty, which is why it is not setting the Ratio Rule. I'm not sure why the $label variable is empty at this point, but hopefully this helps you to know where to look to fix the problem.
 

saroos1

Member
May 25, 2018
718
0
16
Apparently the label is url encoded and the pattern is not when the comparison takes place. So I changed line 53 to:
Thanx.
So the Label is empty, which is why it is not setting the Ratio Rule. I'm not sure why the $label variable is empty at this point, but hopefully this helps you to know where to look to fix the problem.
I will see.
 

lisas4567

Member
May 25, 2018
773
0
16
Errors are fixed (i guess). Try to update from svn.
Updated from svn and everything is working as expected now! The correct ratio group is being applied for manually added torrents (even with labels with slashes), and for torrents added through a watch directory.

Thank you for fixing this so quickly. This is why rutorrent is the best!