Page 1 of 1

Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 7:21 am
by chris-t
Hi there.

I'm using 1.0.0 RC1 with 'Glitter - Night' and I've got a query about the download rate indicated by the speed limit slider.

In Config > General I have my maximum line speed set to 4.4M, because the fastest I can ever download anything on my line is 4.4 megabytes per second (about 35 megabits per second). I've also set the percentage of line speed to 100%.

So if I'm downloading something with no speed limits in place, I can see a steady rate of 4.4 MB/s indicated in the box to the right of the chart. If click on the dropdown arrow to reveal the speed limit slider, it reads 100% (4 MB/s) (about 91% of my specified maximum rate). If I drag the slider to somewhere below 100% the value indicated by the slider does not match the actual download rate, even though the percentage correlates with the actual rate.

For example, if I set the slider to 71%, the actual rate correctly drops to 3.1 MB/s but the rate indicated by the slider is 2.8 MB/s, which again is about 91% of the actual rate (see screenshot).

Image

Have I got something incorrectly configured here, or could this be an issue with either SABnzbd or the Glitter skin?

Thanks very much.

Chris

Re: Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 9:55 am
by safihre
Ah.. That's my fault.. I didn't think people would fill anything else than whole numbers..
I will look into it!

Re: Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 10:08 am
by chris-t
Haha ok!

I have actually just had a look myself and I can see that on line 178 of sabnzbd/interfaces/Glitter/templates/static/javascripts/glitter.js it reads:

Code: Select all

var speedLimitNumber = (parseInt(self.bandwithLimit()) * (self.speedLimit() / 100));
In order for the percentage to display correctly, I'm guessing it would need to change to something like:

Code: Select all

var speedLimitNumber = (parseFloat(self.bandwithLimit()) * (self.speedLimit() / 100));
Chris

Re: Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 10:20 am
by chris-t
I just submitted a pull request. Never done one before, so feel free to disregard if it's wrong!

Re: Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 11:12 am
by safihre
Looks good to me, that's indeed the line that needed to be changed!

Re: Speed limit slider value different to actual rate

Posted: February 23rd, 2016, 11:21 am
by chris-t
Awesome :)