Changeset 78851b
- Timestamp:
- 01/17/2017 09:20:11 AM (8 years ago)
- Children:
- bd80ad
- Parents:
- af76ab
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (01/11/2017 12:58:15 PM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (01/17/2017 09:20:11 AM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/core/torrent.py
raf76ab r78851b 311 311 312 312 def set_file_priorities(self, file_priorities): 313 if len(file_priorities) != len(self.get_files()): 314 log.debug("file_priorities len != num_files") 315 self.options["file_priorities"] = self.handle.file_priorities() 316 return 317 318 if self.options["compact_allocation"]: 319 log.debug("setting file priority with compact allocation does not work!") 320 self.options["file_priorities"] = self.handle.file_priorities() 321 return 313 handle_file_priorities = self.handle.file_priorities() 314 # Workaround for libtorrent 1.1 changing default priorities from 1 to 4. 315 if 4 in handle_file_priorities: 316 handle_file_priorities = [1 if x == 4 else x for x in handle_file_priorities] 322 317 323 318 log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities) 324 319 325 self.handle.prioritize_files(file_priorities) 320 if (self.handle.has_metadata() and not self.options["compact_allocation"] and 321 file_priorities and len(file_priorities) == len(self.get_files())): 322 self.handle.prioritize_files(file_priorities) 323 else: 324 log.debug("Unable to set new file priorities.") 325 file_priorities = handle_file_priorities 326 326 327 327 if 0 in self.options["file_priorities"]: … … 335 335 break 336 336 337 self.options["file_priorities"] = self.handle.file_priorities()337 self.options["file_priorities"] = handle_file_priorities 338 338 if self.options["file_priorities"] != list(file_priorities): 339 339 log.warning("File priorities were not set for this torrent")
Note:
See TracChangeset
for help on using the changeset viewer.