mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 12:04:10 +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
@ -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…
x
Reference in New Issue
Block a user