mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-22 12:34:50 +00:00
Prevent being able to set file priorities for compactly allocated
torrents as it is not intended to work.
This commit is contained in:
parent
ebe53dd634
commit
dd29746084
1 changed files with 8 additions and 1 deletions
|
@ -267,11 +267,18 @@ class Torrent:
|
|||
self.options["remove_at_ratio"] = remove_at_ratio
|
||||
|
||||
def set_file_priorities(self, file_priorities):
|
||||
log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities)
|
||||
if len(file_priorities) != len(self.files):
|
||||
log.debug("file_priorities len != num_files")
|
||||
self.options["file_priorities"] = self.handle.file_priorities()
|
||||
return
|
||||
|
||||
if self.options["compact_allocation"]:
|
||||
log.debug("setting file priority with compact allocation does not work!")
|
||||
self.options["file_priorities"] = self.handle.file_priorities()
|
||||
return
|
||||
|
||||
log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities)
|
||||
|
||||
self.handle.prioritize_files(file_priorities)
|
||||
|
||||
if 0 in self.options["file_priorities"]:
|
||||
|
|
Loading…
Add table
Reference in a new issue