From 1f63e3de1ae9799ce3c03abaa5ed0630ba65668a Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 2 Apr 2009 20:55:46 +0000 Subject: [PATCH] remove get_torrent_info from ui.common add an "as_dict" method to TorrentInfo utilise the TorrentInfo class rather than get_torrent_info --- deluge/ui/web/js/deluge-add.js | 2 +- deluge/ui/web/json_api.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/deluge-add.js b/deluge/ui/web/js/deluge-add.js index d0c50a3bc..175e960fc 100644 --- a/deluge/ui/web/js/deluge-add.js +++ b/deluge/ui/web/js/deluge-add.js @@ -93,7 +93,7 @@ Deluge.Add = { this.clearFiles(); var root = this.Files.getRootNode(); - walk(torrentInfo['files'], root); + walk(torrentInfo['files_tree'], root); root.firstChild.expand(); }, diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 71f3cd426..d4c61fb92 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -397,7 +397,8 @@ class WebApi(JSONComponent): """ d = Deferred() try: - d.callback(uicommon.get_torrent_info(filename.strip())) + torrent_info = uicommon.TorrentInfo(filename.strip()) + d.callback(torrent_info.as_dict("name", "info_hash", "files_tree")) except: d.callback(False) return d