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:
parent
5162d5d7e2
commit
1f63e3de1a
|
@ -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();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue