From 98dcc8e3b1c2f0fffe66fd17af78eff24ff3a5ec Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 18 Jan 2012 23:15:27 +0000 Subject: [PATCH] Fix stored file priorities settings File priorities stored in torrent options were based upon the supplied funtion values rather than the current values stored in libtorrent. So if the priorities failed to be set by libtorrent the settings would be out of sync. --- deluge/core/torrent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 6764f0887..261ce6f77 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -316,7 +316,9 @@ class Torrent(object): self.update_state() break - self.options["file_priorities"] = file_priorities + self.options["file_priorities"] = self.handle.file_priorities() + if self.options["file_priorities"] != file_priorities: + log.warning("File priorities were not set for this torrent") # Set the first/last priorities if needed self.set_prioritize_first_last(self.options["prioritize_first_last_pieces"])