google-code-export / rtgui

Automatically exported from code.google.com/p/rtgui
1 stars 0 forks source link

Setting file priorities not working #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add Torrent
2. View Files for torrent
3. Set priority on all Files in torrent to "Off" except one
4. Note that all files continue to download...

What is the expected output? Expected that files with priority of "Off"
would not download.

What do you see instead? All files continue to download.

What version of the product are you using? v0.2.4

On what operating system? Ubuntu 8.10

Original issue reported on code.google.com by jap...@gmail.com on 14 Dec 2008 at 6:21

GoogleCodeExporter commented 9 years ago
It's possible this is actually an issue with rTorrent, rather than with rtGui...

Original comment by jap...@gmail.com on 14 Dec 2008 at 9:40

GoogleCodeExporter commented 9 years ago
Indeed, this is very probably rTorrent behaviour.  Please confirm by performing 
the 
same action in rTorrent itself and noting behaviour.

Original comment by lemonbe...@gmail.com on 14 Dec 2008 at 12:08

GoogleCodeExporter commented 9 years ago
It appears this is a known issue with rTorrent, even though it appears to be 
being
denied by the developers so far.  This is the ticket I found:
http://libtorrent.rakshasa.no/ticket/1120

Original comment by jap...@gmail.com on 15 Dec 2008 at 4:04

GoogleCodeExporter commented 9 years ago
Admittedly, I am in no means a fan of the way rTorrent handles this.  To the 
best of
my understanding, once rTorrent starts leeching pieces of a file, you may no 
longer
set the priority to "off" -- well, you can, it just won't function as that.

If you load the torrent in a stopped state, set your priorities, and then start 
the
torrent, does it work as desired?  (It should -- I've never had any luck 
actually
pulling it off personally, though.)

Original comment by llamaXxX@gmail.com on 18 Dec 2008 at 5:42

GoogleCodeExporter commented 9 years ago
There's a few problems with that.  rtgui starts torrents when it adds them by
default, so all files are created, and I can't load through rtgui in a "stopped"
state.  Also, what constitutes starting leeching pieces of a file?  Because if I
start a torrent with 2gb worth of files, all only 5mb-100mb in size, and set 
them all
to off, surely not all of them had already "started"?  Yet... they ALL 
downloaded.

Original comment by jap...@gmail.com on 18 Dec 2008 at 6:21

GoogleCodeExporter commented 9 years ago
Well, this won't help you a bit, but I double checked and it works for me.  :p

Cmp Pri  Size   Filename
  0 off 163.3 K| 01.png
  0 off 242.5 K| 02.png
 25 off 220.1 K| 03.png
100     270.4 K| 04.png
100     259.0 K| 05.png
100     315.6 K| 06.png
100     227.9 K| 07.png
100     265.2 K| 08.png
 20 off 266.2 K| 09.png
  0 off 260.1 K| 10.png
 16 off 263.0 K| 11.png
100     242.0 K| 12.png
100     232.4 K| 13.png
100     255.6 K| 14.png
 75 off 217.2 K| 15.png
100     271.4 K| 16.png
100     223.0 K| 17.png

Files 1-3 and 15 were set to "off" while the torrent was loaded as "stopped".
Files 9-11 were set to "off" after starting the torrent, but before any chunks
were downloaded.  In both cases, it seems to work just fine.  (The partially
completed "off" files are due to shared chunks in this case.)

As rtGui does indeed seem to be setting the "off" flag properly, this would
appear to be an issue with your copy of rTorrent.  You likely stand a better
chance of resolving this by directing it to the rTorrent mailing list:

http://rakshasa.no/mailman/listinfo/libtorrent-devel

Original comment by llamaXxX@gmail.com on 18 Dec 2008 at 5:27

GoogleCodeExporter commented 9 years ago
I have gotten a response on the rTorrent ticket, so following up there.  Also, 
rtGui
doesn't allow me to add torrents as "stopped", how can I do this?

Original comment by jap...@gmail.com on 19 Dec 2008 at 3:32

GoogleCodeExporter commented 9 years ago
I can't tell you how much I appreciate all the work that has gone into this app,
unfortunately it does look like this is an rtGui issue.

As per the the 12/22/08 11:20:38 comment at
http://libtorrent.rakshasa.no/ticket/1120, rtGui is not calling 
d.update_priorities
after looping through all of the necessary f.set_priority calls.

My personal install of rtGui has been modified, but the following quick dirty 
hack
has fixed the issue for me.  Checking the unmodified code, this appears to be 
at line
68 of rtGui 0.2.6's control.php:

// Set file priorities...
if (isset($r_set_fpriority)) {
   $index=0;
   foreach($r_set_fpriority as $item) {

$response=do_xmlrpc(xmlrpc_encode_request("f.set_priority",array("$r_hash",$inde
x,"$item")));
      $index++;
   }
// HACK!
   $response=do_xmlrpc(xmlrpc_encode_request("d.update_priorities","$r_hash"));
// END HACK!
   $r_cmd="";
}

Original comment by michael....@gmail.com on 3 Jan 2009 at 12:23

GoogleCodeExporter commented 9 years ago
Thanks so much for posting this!  I'll implement your bug-fix until it's 
updated in 
the next version of rtGui.  Thanks again, I really appreciate you posting a 
solution 
:)

Original comment by jap...@gmail.com on 3 Jan 2009 at 1:05

GoogleCodeExporter commented 9 years ago
I hope it fixes the problem for you.  Regarding loading torrents without 
immediately
starting them, I don't know if there are plans to make this optional but since I
wanted to do the same thing I just went into control.php again.  Just below the
comment "// Add torrent URL..." you'll see:

$response = do_xmlrpc(xmlrpc_encode_request("load_start",array("$r_addurl")));

Just change "load_start" to "load" and you're off to the races!  Now torrents
shouldn't start downloading until you tell them to.  Of course you can also 
drop a
var in config.php and call it from control.php if you want:

config.php:
// Start download immediately after loading torrent
$load_start=FALSE;

control.php:
// Add torrent URL...
global $load_start;
if (isset($r_addurl)) {
   if ($load_start)
     $response = do_xmlrpc(xmlrpc_encode_request("load_start",array("$r_addurl")));
   else
     $response = do_xmlrpc(xmlrpc_encode_request("load",array("$r_addurl")));
}

Of course these are very minor hacks made simply to have rtGui deal with my
nit-picking.  All of the hard work has already been done for us by lemonberry 
and any
other contributors.  Thanks again guys!

Original comment by michael....@gmail.com on 3 Jan 2009 at 1:33

GoogleCodeExporter commented 9 years ago
Thanks for those!  I'll be sure to implement them too  :)
I've already done a few hacks of my own to improve on the handling of multiple 
files 
and sorting / viewing etc.  Purely for my own preferences.

Great work on rtGui everyone!

Original comment by jap...@gmail.com on 3 Jan 2009 at 2:18

GoogleCodeExporter commented 9 years ago
I'm adding the code for the update_priorities hack, and optional start-on-load 
config which will be configurable via the settings dialog in rtGui.  Thanks 
Michael 
for the code, and others for the bug hunting! 

Next release soon

Original comment by lemonbe...@gmail.com on 8 Jan 2009 at 8:33

GoogleCodeExporter commented 9 years ago
Fixed in version 0.2.7

Original comment by lemonbe...@gmail.com on 16 Mar 2009 at 10:19