snowyu / libtorrent

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

Create two folder with new and old name of the folder. Pre-allocate file that is unchecked not to download #625

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use a torrent that have a folder and two or more files inside the folder.

2. Open the torrent and rename the folder.

3. Uncheck one of the file you do not wanted to download.

4. Click ok to add torrent to client to start downloading.

What is the expected output? 

The expected output is that it should only created the new folder with the 
selected files you wanted to download.

What do you see instead?

There are two issues. 

1. It create both the new folder name and old/original folder name.

2. For files you uncheck, it still pre-allocate the file.

What version of the product are you using? On what operating system?

Windows 8.1 using qBittorrent 3.1.9.2 and libtorrent 0.16.16.0

Please provide any additional information below.

More information on the following forum.

http://qbforums.shiki.hu/index.php?topic=2601.msg11230#msg11230

http://qbforums.shiki.hu/index.php/topic,2572.0.html

Original issue reported on code.google.com by magic63k...@gmail.com on 18 May 2014 at 9:43

GoogleCodeExporter commented 9 years ago
What does it mean to rename a directory?

My guess would be to, on the torrent_info object, rename all files in this 
directory to have a different name for this one directory segment. This is then 
presumably done before the torrent is added with session::add_torrent().

Also, presumably the file that should not be downloaded is renamed similarly, 
right? It will most likely still be created, and if it's still in the old 
folder name, that folder will be created. If this is not desired, all 
unselected files should probably be renamed and put in a separate directory, 
perhaps it could be called ".parts" to conveniently be hidden.

Please confirm my assumptions, because my first guess would be that this is the 
cause of (1).

As for (2), my guess there would be that the priorities of the unselected files 
are set _after_ the torrent is added. If that is the case, it's too late. The 
files have already been allocated. Instead, the priorities must be set as part 
of the add_torrent_params structure. If set there, libtorrent will know the 
file's priorities at the time of allocating them, and it will not allocate 
unselected files.

Original comment by arvid.no...@gmail.com on 20 May 2014 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by arvid.no...@gmail.com on 29 Jun 2014 at 8:58