From 392497222c829da9c622ecfde9408fb6d08f8122 Mon Sep 17 00:00:00 2001 From: Martin Hertz Date: Fri, 29 Mar 2024 22:48:52 +0100 Subject: [PATCH 1/3] [Console] Fix 'move' command hanging when done Console.get_torrent_name() expects string, but was given list from console.match_torrent(), so NoneType breaking join() in move message. --- deluge/ui/console/cmdline/commands/move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/cmdline/commands/move.py b/deluge/ui/console/cmdline/commands/move.py index 67ee0af1d6..211a82ebd9 100644 --- a/deluge/ui/console/cmdline/commands/move.py +++ b/deluge/ui/console/cmdline/commands/move.py @@ -46,7 +46,8 @@ def handle(self, options): for t_id in options.torrent_ids: tid = self.console.match_torrent(t_id) ids.extend(tid) - names.append(self.console.get_torrent_name(tid)) + for name in tid: + names.append(self.console.get_torrent_name(name)) def on_move(res): msg = 'Moved "{}" to {}'.format(', '.join(names), options.path) From c49c3d2f60afe0f52094f2d7c2c2496750349887 Mon Sep 17 00:00:00 2001 From: Martin Hertz Date: Tue, 10 Sep 2024 09:37:17 +0200 Subject: [PATCH 2/3] Update deluge/ui/console/cmdline/commands/move.py Co-authored-by: Calum Lind --- deluge/ui/console/cmdline/commands/move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/cmdline/commands/move.py b/deluge/ui/console/cmdline/commands/move.py index 211a82ebd9..e6de51c4b3 100644 --- a/deluge/ui/console/cmdline/commands/move.py +++ b/deluge/ui/console/cmdline/commands/move.py @@ -46,8 +46,8 @@ def handle(self, options): for t_id in options.torrent_ids: tid = self.console.match_torrent(t_id) ids.extend(tid) - for name in tid: - names.append(self.console.get_torrent_name(name)) + ids = self.console.match_torrents(options.torrent_ids) + names = [self.console.get_torrent_name(id) for id in ids] def on_move(res): msg = 'Moved "{}" to {}'.format(', '.join(names), options.path) From 8b9c2836fe4a6c9dfaac4b2e20a998c51725b1b9 Mon Sep 17 00:00:00 2001 From: Martin Hertz Date: Tue, 10 Sep 2024 14:22:53 +0200 Subject: [PATCH 3/3] [Console] Fix 'move' command hanging when done Console.get_torrent_name() expects string, but was given list from console.match_torrent(), so NoneType breaking join() in move message. Simplified and fixed now. Co-authored-by: Calum Lind --- deluge/ui/console/cmdline/commands/move.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/deluge/ui/console/cmdline/commands/move.py b/deluge/ui/console/cmdline/commands/move.py index e6de51c4b3..1691f171b5 100644 --- a/deluge/ui/console/cmdline/commands/move.py +++ b/deluge/ui/console/cmdline/commands/move.py @@ -41,13 +41,8 @@ def handle(self, options): ) return - ids = [] - names = [] - for t_id in options.torrent_ids: - tid = self.console.match_torrent(t_id) - ids.extend(tid) - ids = self.console.match_torrents(options.torrent_ids) - names = [self.console.get_torrent_name(id) for id in ids] + ids = self.console.match_torrents(options.torrent_ids) + names = [self.console.get_torrent_name(id_) for id_ in ids] def on_move(res): msg = 'Moved "{}" to {}'.format(', '.join(names), options.path)