From f7a4951e0d961d74bac8559e80551eb8bd3dd4d7 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Fri, 1 Jun 2012 21:04:02 +0200 Subject: [PATCH] Fixed sorting by ETA --- deluge/ui/console/modes/alltorrents.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 28a404e4d..a4400179d 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -551,6 +551,9 @@ class AllTorrents(BaseMode, component.Component): else: result = sorted(result, cmp_func, sort_key, reverse) + if field == "eta": + result = sorted(result, key=lambda s: state.get(s)["eta"] == 0) + return result #Just in case primary and secondary fields are empty and/or