summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2019-05-18 12:23:34 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2019-05-18 17:15:27 +0200
commitcbcf8eb8637d18374ad26ce21c5b4a8cac852970 (patch)
tree293f991546fa65c837ffe4792edf8f6bbddffa2d
parent[bencode] Fix unhandled TypeError with string (diff)
downloaddeluge-cbcf8eb8637d18374ad26ce21c5b4a8cac852970.tar.xz
deluge-cbcf8eb8637d18374ad26ce21c5b4a8cac852970.zip
[GTK] Fix missing magnet trackers with Add dialog (non-prefetch)
When adding magnets (without prefetch) the trackers were missing. The issue was that the magnet uri was being xml escaped twice so that the ampersand was still escaped when passed to core and everything after the magnet info_hash was ignored. Also found unneeded call to core.add_torrent_files when only adding magnets with core.add_torrent_magnet so check torrents_to_add before calling.
-rw-r--r--deluge/ui/gtk3/addtorrentdialog.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/deluge/ui/gtk3/addtorrentdialog.py b/deluge/ui/gtk3/addtorrentdialog.py
index 72841c616..d164c2cc5 100644
--- a/deluge/ui/gtk3/addtorrentdialog.py
+++ b/deluge/ui/gtk3/addtorrentdialog.py
@@ -302,7 +302,7 @@ class AddTorrentDialog(component.Component):
torrent_id = magnet['info_hash']
files = magnet['files_tree']
if not self._add_torrent_liststore(
- torrent_id, magnet['name'], xml_escape(uri), files, None
+ torrent_id, magnet['name'], uri, files, None
):
already_added += 1
continue
@@ -924,7 +924,10 @@ class AddTorrentDialog(component.Component):
else:
log.info('Successfully added %d torrents.', len(torrents_to_add))
- client.core.add_torrent_files(torrents_to_add).addCallback(on_torrents_added)
+ if torrents_to_add:
+ client.core.add_torrent_files(torrents_to_add).addCallback(
+ on_torrents_added
+ )
def on_button_apply_clicked(self, widget):
log.debug('on_button_apply_clicked')