From dd29746084c66e7930d5fe6ba383b6533ed5f4c1 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 8 Oct 2008 12:42:59 +0000 Subject: [PATCH] Prevent being able to set file priorities for compactly allocated torrents as it is not intended to work. --- deluge/core/torrent.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 1c5b8cc3c..38f0643a9 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -267,11 +267,18 @@ class Torrent: self.options["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.options["file_priorities"]: