mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +00:00
[#2990] [Core] Fix torrent priorities mismatch
* The old priorities instead of updated call to lt were being saved to self.options.
This commit is contained in:
parent
73ea123f1a
commit
482606d80a
1 changed files with 2 additions and 4 deletions
|
@ -479,8 +479,6 @@ class Torrent(object):
|
||||||
file_priorities (list of int): List of file priorities.
|
file_priorities (list of int): List of file priorities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
torrent_fprios = self.handle.file_priorities()
|
|
||||||
|
|
||||||
if log.isEnabledFor(logging.DEBUG):
|
if log.isEnabledFor(logging.DEBUG):
|
||||||
log.debug('Setting %s file priorities to: %s', self.torrent_id, file_priorities)
|
log.debug('Setting %s file priorities to: %s', self.torrent_id, file_priorities)
|
||||||
|
|
||||||
|
@ -489,7 +487,7 @@ class Torrent(object):
|
||||||
self.handle.prioritize_files(file_priorities)
|
self.handle.prioritize_files(file_priorities)
|
||||||
else:
|
else:
|
||||||
log.debug('Unable to set new file priorities.')
|
log.debug('Unable to set new file priorities.')
|
||||||
file_priorities = torrent_fprios
|
file_priorities = self.handle.file_priorities()
|
||||||
|
|
||||||
if 0 in self.options['file_priorities']:
|
if 0 in self.options['file_priorities']:
|
||||||
# Previously marked a file 'Do Not Download' so check if changed any 0's to >0.
|
# Previously marked a file 'Do Not Download' so check if changed any 0's to >0.
|
||||||
|
@ -501,7 +499,7 @@ class Torrent(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
# Ensure stored options are in sync in case file_priorities were faulty (old state?).
|
# Ensure stored options are in sync in case file_priorities were faulty (old state?).
|
||||||
self.options['file_priorities'] = torrent_fprios
|
self.options['file_priorities'] = self.handle.file_priorities()
|
||||||
|
|
||||||
# Set the first/last priorities if needed.
|
# Set the first/last priorities if needed.
|
||||||
if self.options['prioritize_first_last_pieces']:
|
if self.options['prioritize_first_last_pieces']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue