mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 19:55:57 +00:00
Only assign prioritize_first_last_pieces to torrent options if actually changed
This commit is contained in:
parent
275c939b95
commit
56a24f16f2
@ -260,11 +260,11 @@ class Torrent(object):
|
|||||||
self.handle.set_download_limit(v)
|
self.handle.set_download_limit(v)
|
||||||
|
|
||||||
def set_prioritize_first_last(self, prioritize):
|
def set_prioritize_first_last(self, prioritize):
|
||||||
self.options["prioritize_first_last_pieces"] = prioritize
|
|
||||||
if prioritize:
|
if prioritize:
|
||||||
if self.handle.has_metadata():
|
if self.handle.has_metadata():
|
||||||
if self.handle.get_torrent_info().num_files() == 1:
|
if self.handle.get_torrent_info().num_files() == 1:
|
||||||
# We only do this if one file is in the torrent
|
# We only do this if one file is in the torrent
|
||||||
|
self.options["prioritize_first_last_pieces"] = prioritize
|
||||||
priorities = [1] * self.handle.get_torrent_info().num_pieces()
|
priorities = [1] * self.handle.get_torrent_info().num_pieces()
|
||||||
priorities[0] = 7
|
priorities[0] = 7
|
||||||
priorities[-1] = 7
|
priorities[-1] = 7
|
||||||
|
Loading…
x
Reference in New Issue
Block a user