From 3da5cd9816c9ddc5ea30779934d6e1a65e03d399 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 21 Feb 2011 17:43:35 +0100 Subject: [PATCH] add get_torrent_name --- deluge/ui/console/modes/alltorrents.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index e9d1899d2..ee57a59e5 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -258,6 +258,12 @@ class AllTorrents(BaseMode): if refresh: self.refresh() + def get_torrent_name(self, torrent_id): + for p,i in enumerate(self._sorted_ids): + if torrent_id == i: + return self.torrent_names[p] + return None + def _scroll_up(self, by): prevoff = self.curoff self.cursel = max(self.cursel - by,1)