From acd64e6381a43a8bcc0477279d453ea2a352f902 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 8 Oct 2008 12:42:59 +0000 Subject: Prevent being able to set file priorities for compactly allocated torrents as it is not intended to work. --- ChangeLog | 2 ++ deluge/core/torrent.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 524ed71ed..afd4df43c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ Deluge 1.0.1 (In Development) * Removed the 'Maximum Connections Per Second' setting and replaced it with a default setting of 20. This should alleviate speed issues some are experiencing. * Changed max half-open connections default limit to 8 on XP/2000 and 4 on Vista + * Prevent being able to set file priorities for compactly allocated torrents as + it is not intended to work. GtkUI: * Improve performance of files tab by only updating when values change diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 57dce0fad..a806f4e18 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -184,11 +184,18 @@ class Torrent: self.remove_at_ratio = remove_at_ratio def set_file_priorities(self, file_priorities): - log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities) if len(file_priorities) != len(self.files): log.debug("file_priorities len != num_files") + self.options["file_priorities"] = self.handle.file_priorities() return - + + if self.options["compact_allocation"]: + log.debug("setting file priority with compact allocation does not work!") + self.options["file_priorities"] = self.handle.file_priorities() + return + + log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities) + self.handle.prioritize_files(file_priorities) if 0 in self.file_priorities: -- cgit