From d6e9c2141e5aed3b24c85d0061746517d75b4708 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 2 Apr 2009 20:59:15 +0000 Subject: [PATCH] need to store the filename in the info dict that gets returned by the server --- deluge/ui/web/js/deluge-add.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/ui/web/js/deluge-add.js b/deluge/ui/web/js/deluge-add.js index 175e960fc..5a92bae33 100644 --- a/deluge/ui/web/js/deluge-add.js +++ b/deluge/ui/web/js/deluge-add.js @@ -97,7 +97,7 @@ Deluge.Add = { root.firstChild.expand(); }, - onTorrentAdded: function(info) { + onTorrentAdded: function(info, filename) { if (!info) { Ext.MessageBox.show({ title: _('Error'), @@ -109,6 +109,7 @@ Deluge.Add = { }); return; } + info['filename'] = filename; this.Store.loadData([[info['info_hash'], info['name']]], true); this.torrents[info['info_hash']] = info; }, @@ -254,7 +255,7 @@ Deluge.Add.File = { var filename = upload.result.toString(); this.form.items.get('torrentFile').setValue(''); Deluge.Client.web.get_torrent_info(filename, { - onSuccess: Deluge.Add.onTorrentAdded.bindWithEvent(Deluge.Add) + onSuccess: Deluge.Add.onTorrentAdded.bindWithEvent(Deluge.Add, filename) }); } } @@ -312,7 +313,7 @@ Deluge.Add.Url = { onDownload: function(filename) { this.form.items.get('url').setValue(''); Deluge.Client.web.get_torrent_info(filename, { - onSuccess: Deluge.Add.onTorrentAdded.bindWithEvent(Deluge.Add) + onSuccess: Deluge.Add.onTorrentAdded.bindWithEvent(Deluge.Add, filename) }); } }