Fix prioritize first/last pieces for magnet links
This commit is contained in:
parent
c58221c866
commit
8911600155
|
@ -9,6 +9,7 @@
|
|||
* #2109: Fix the Proxy settings not being cleared by setting None
|
||||
* #2110: Fix accepting magnet uris with xt param anywhere within them
|
||||
* #2204: Fix daemon shutdown hang with large numbers of torrents
|
||||
* Fix prioritize first/last pieces option for magnet links
|
||||
|
||||
==== Client ====
|
||||
* Fix keyerrors after removing torrents from UIs
|
||||
|
|
|
@ -868,6 +868,11 @@ class Torrent(object):
|
|||
self.handle.save_resume_data()
|
||||
self.waiting_on_resume_data = True
|
||||
|
||||
def on_metadata_received(self):
|
||||
if self.options["prioritize_first_last_pieces"]:
|
||||
self.set_prioritize_first_last(True)
|
||||
self.write_torrentfile()
|
||||
|
||||
def write_torrentfile(self):
|
||||
"""Writes the torrent file"""
|
||||
path = "%s/%s.torrent" % (
|
||||
|
|
|
@ -1110,7 +1110,7 @@ class TorrentManager(component.Component):
|
|||
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||
except:
|
||||
return
|
||||
torrent.write_torrentfile()
|
||||
torrent.on_metadata_received()
|
||||
|
||||
def on_alert_file_error(self, alert):
|
||||
log.debug("on_alert_file_error: %s", alert.message())
|
||||
|
|
Loading…
Reference in New Issue