remove get_torrent_info from ui.common

add an "as_dict" method to TorrentInfo
utilise the TorrentInfo class rather than get_torrent_info
This commit is contained in:
Damien Churchill 2009-04-02 20:55:46 +00:00
parent 5162d5d7e2
commit 1f63e3de1a
2 changed files with 3 additions and 2 deletions

View File

@ -93,7 +93,7 @@ Deluge.Add = {
this.clearFiles(); this.clearFiles();
var root = this.Files.getRootNode(); var root = this.Files.getRootNode();
walk(torrentInfo['files'], root); walk(torrentInfo['files_tree'], root);
root.firstChild.expand(); root.firstChild.expand();
}, },

View File

@ -397,7 +397,8 @@ class WebApi(JSONComponent):
""" """
d = Deferred() d = Deferred()
try: 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: except:
d.callback(False) d.callback(False)
return d return d