From 882a7e803388dcdf8674b049fdc8b72f044518a9 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Wed, 5 Mar 2008 19:10:21 +0000 Subject: [PATCH] core:fix multiple queue_up/down --- deluge/core/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/core/core.py b/deluge/core/core.py index 4d00d9a7a..db72dd423 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -538,6 +538,8 @@ class Core( def export_queue_up(self, torrent_ids): log.debug("Attempting to queue %s to up", torrent_ids) + #torrent_ids must be sorted before moving. + torrent_ids.sort(key = lambda id: self.torrents.torrents[id].get_queue_position()) for torrent_id in torrent_ids: try: # If the queue method returns True, then we should emit a signal @@ -548,6 +550,8 @@ class Core( def export_queue_down(self, torrent_ids): log.debug("Attempting to queue %s to down", torrent_ids) + #torrent_ids must be sorted before moving. + torrent_ids.sort(key = lambda id: -self.torrents.torrents[id].get_queue_position()) for torrent_id in torrent_ids: try: # If the queue method returns True, then we should emit a signal