Fix adding peers
This commit is contained in:
parent
a36938729b
commit
da2499faa6
@ -450,10 +450,10 @@ class Core(
|
|||||||
if not self.torrents[torrent_id].pause():
|
if not self.torrents[torrent_id].pause():
|
||||||
log.warning("Error pausing torrent %s", torrent_id)
|
log.warning("Error pausing torrent %s", torrent_id)
|
||||||
|
|
||||||
def export_connect_peer(self, torrent_id, ip):
|
def export_connect_peer(self, torrent_id, ip, port):
|
||||||
log.debug("adding peer %s to %s", ip, torrent_id)
|
log.debug("adding peer %s to %s", ip, torrent_id)
|
||||||
if not self.torrents[torrent_id].connect_peer(ip):
|
if not self.torrents[torrent_id].connect_peer(ip, port):
|
||||||
log.warning("Error adding peer %s to %s", ip, torrent_id)
|
log.warning("Error adding peer %s:%s to %s", ip, port, torrent_id)
|
||||||
|
|
||||||
def export_move_storage(self, torrent_ids, dest):
|
def export_move_storage(self, torrent_ids, dest):
|
||||||
log.debug("Moving storage %s to %s", torrent_ids, dest)
|
log.debug("Moving storage %s to %s", torrent_ids, dest)
|
||||||
|
|||||||
@ -698,11 +698,12 @@ class Torrent:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def connect_peer(self, ip):
|
def connect_peer(self, ip, port):
|
||||||
"""adds manual peer"""
|
"""adds manual peer"""
|
||||||
try:
|
try:
|
||||||
self.handle.connect_peer(ip)
|
self.handle.connect_peer((ip, int(port)), 0)
|
||||||
except:
|
except Exception, e:
|
||||||
|
log.debug("Unable to connect to peer: %s", e)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@ -159,6 +159,6 @@ def add_peer_dialog():
|
|||||||
if deluge.common.is_ip(ip):
|
if deluge.common.is_ip(ip):
|
||||||
id = component.get("TorrentView").get_selected_torrent()
|
id = component.get("TorrentView").get_selected_torrent()
|
||||||
log.debug("adding peer %s to %s", value, id)
|
log.debug("adding peer %s to %s", value, id)
|
||||||
client.connect_peer(id, value)
|
client.connect_peer(id, ip, port)
|
||||||
peer_dialog.destroy()
|
peer_dialog.destroy()
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user