Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit 2b364c6f authored by miigotu's avatar miigotu
Browse files

Fix magnets in rtorrent, Fixes #2880


Signed-off-by: default avatarmiigotu <miigotu@gmail.com>
parent 87e5ce80
Branches
Tags
No related merge requests found
...@@ -245,11 +245,14 @@ class RTorrent: ...@@ -245,11 +245,14 @@ class RTorrent:
if verify_load: if verify_load:
for i in range(MAX_RETRIES): for i in range(MAX_RETRIES):
time.sleep(1) time.sleep(1)
if self.find_torrent(info_hash): torrent = self.find_torrent(info_hash)
if torrent:
torrent.start()
break break
assert find_torrent(info_hash, self.torrents), "Adding torrent was unsuccessful (load_magnet)." assert find_torrent(info_hash, self.torrents), "Adding torrent was unsuccessful (load_magnet)."
time.sleep(3)
return self.find_torrent(info_hash) return self.find_torrent(info_hash)
def load_torrent(self, torrent, start=False, verbose=False, verify_load=True): # @IgnorePep8 def load_torrent(self, torrent, start=False, verbose=False, verify_load=True): # @IgnorePep8
......
...@@ -58,8 +58,9 @@ def find_torrent(info_hash, torrent_list): ...@@ -58,8 +58,9 @@ def find_torrent(info_hash, torrent_list):
@return: L{Torrent} instance, or -1 if not found @return: L{Torrent} instance, or -1 if not found
""" """
t = filter(lambda x: x.info_hash == info_hash, torrent_list) for t in torrent_list:
return t[0] if t else None if t.info_hash == info_hash:
return t
def is_valid_port(port): def is_valid_port(port):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment