Opened 9 years ago

Closed 8 years ago

Last modified 4 years ago

#2211 closed bug (Fixed)

Cannot disable downloading of individual files

Reported by: atrigent Owned by: gazpachoking
Priority: minor Milestone: 2.x
Component: Unknown Version: master
Keywords: Cc:

Description

If I set specific files in a torrent to "Do not download", the setting is remembered but the files continue to download. The torrent overall acts as if no files have been set as do not download.

Change History (8)

comment:1 Changed 9 years ago by gazpachoking

  • Owner set to gazpachoking
  • Status changed from new to accepted

There were some major issues with prioritize_first_last implementation which was causing every piece of a torrent to be set to highest priority (when the option was enabled) or normal priority (even when the file was not set to download). I believe I have fixed them up in 9d28aa9521

comment:2 Changed 9 years ago by gazpachoking

  • Milestone set to 1.4.0

comment:3 Changed 9 years ago by atrigent

This change produced the following error:

02:00:01.988 [ERROR ][deluge.core.torrentmanager :690 ] Torrent state file is either corrupt or incompatible! 'torrent_handle' object has no attribute 'file_priority'

All of my torrents disappeared.

There are two problems here. One is either that there are no checks to make sure that libtorrent 0.16 is in use OR that a feature that is new in 0.16 is used unconditionally.

The other problem is that this should not have caused all of my torrents to disappear. It should only have caused the prioritize first/last feature to fail. In addition, the error message is misleading/incorrect.

I would also prefer for "corrupt" files to be moved aside for further examination rather than simply deleted/overwritten.

comment:4 Changed 9 years ago by atrigent

That function does exist in libtorrent 0.15, but it is not in the python bindings.

http://libtorrent.svn.sourceforge.net/viewvc/libtorrent?view=revision&revision=6927 http://libtorrent.svn.sourceforge.net/viewvc/libtorrent?view=revision&revision=6928

The fix to the bindings was applied to trunk and the RC_0_16 branch. It was applied after 0.16.0 was released, so even that release would produce this error.

comment:5 Changed 9 years ago by atrigent

This fixes it for me:

--- a/deluge/core/torrent.py 2012-11-13 03:43:17.050561338 -0500 +++ b/deluge/core/torrent.py 2012-11-13 03:36:18.000000000 -0500 @@ -315,7 +315,7 @@

for n in range(ti.num_pieces()):

slices = ti.map_block(n, 0, ti.piece_size(n)) for slice in slices:

  • if self.handle.file_priority(slice.file_index):

+ if self.handle.file_priorities()[slice.file_index]:

paths.setdefault(slice.file_index, []).append(n)

priorities = self.handle.piece_priorities()

comment:6 Changed 9 years ago by atrigent

Let's try that again.

--- a/deluge/core/torrent.py     2012-11-13 03:43:17.050561338 -0500
+++ b/deluge/core/torrent.py     2012-11-13 03:36:18.000000000 -0500
@@ -315,7 +315,7 @@
             for n in range(ti.num_pieces()):
                 slices = ti.map_block(n, 0, ti.piece_size(n))
                 for slice in slices:
-                    if self.handle.file_priority(slice.file_index):
+                    if self.handle.file_priorities()[slice.file_index]:
                         paths.setdefault(slice.file_index, []).append(n)
 
             priorities = self.handle.piece_priorities()

comment:7 Changed 8 years ago by gazpachoking

  • Resolution set to fixed
  • Status changed from accepted to closed

This is now fully fixed in master.

comment:8 Changed 4 years ago by Cas

  • Milestone changed from 2.0.x to 2.x

Milestone renamed

Note: See TracTickets for help on using tickets.