From 5a33e66c2ce514e1e998f67e5669ca87b39df75d Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 26 May 2012 17:34:16 +0200 Subject: [PATCH] Fix add command reporting success for some failures --- deluge/ui/console/commands/add.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/commands/add.py b/deluge/ui/console/commands/add.py index e54266180..00018e448 100644 --- a/deluge/ui/console/commands/add.py +++ b/deluge/ui/console/commands/add.py @@ -65,9 +65,12 @@ class Command(BaseCommand): t_options["download_location"] = os.path.expanduser(options["path"]) def on_success(result): - self.console.write("{!success!}Torrent added!") + if not result: + self.console.write("{!error!}Torrent was not added: Already in session") + else: + self.console.write("{!success!}Torrent added!") def on_fail(result): - self.console.write("{!error!}Torrent was not added! %s" % result) + self.console.write("{!error!}Torrent was not added: %s" % result) # Keep a list of deferreds to make a DeferredList deferreds = []