[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.

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 <calumlind+deluge@gmail.com>
Closes: https://github.com/deluge-torrent/deluge/pull/447
This commit is contained in:
Martin Hertz 2024-03-29 22:48:52 +01:00 committed by Calum Lind
parent d064ad06c5
commit 40d4f7efef
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 2 additions and 6 deletions

View File

@ -41,12 +41,8 @@ class Command(BaseCommand):
)
return
ids = []
names = []
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))
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)