mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
[#2901] [GTKUI] Strip whitespace from infohash entry before checks
* Copy-pasting from web page can include extra space at end of string. * Also make minor change to populate the magnet name with infohash for nicer UI display.
This commit is contained in:
parent
798f5e2deb
commit
f57ee74ee2
@ -740,7 +740,8 @@ class AddTorrentDialog(component.Component):
|
||||
entry.grab_focus()
|
||||
dialog.show_all()
|
||||
response = dialog.run()
|
||||
if response == gtk.RESPONSE_OK and len(entry.get_text()) == 40:
|
||||
infohash = entry.get_text().strip()
|
||||
if response == gtk.RESPONSE_OK and len(infohash) == 40:
|
||||
trackers = []
|
||||
b = textview.get_buffer()
|
||||
lines = b.get_text(b.get_start_iter(), b.get_end_iter()).strip().split("\n")
|
||||
@ -751,9 +752,7 @@ class AddTorrentDialog(component.Component):
|
||||
# Convert the information to a magnet uri, this is just easier to
|
||||
# handle this way.
|
||||
log.debug("trackers: %s", trackers)
|
||||
magnet = deluge.common.create_magnet_uri(
|
||||
infohash=entry.get_text().decode("utf_8"),
|
||||
trackers=trackers)
|
||||
magnet = deluge.common.create_magnet_uri(infohash, infohash, trackers)
|
||||
log.debug("magnet uri: %s", magnet)
|
||||
self.add_from_magnets([magnet])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user