mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
[#2956] Fix empty file_priorities with magnets
This commit is contained in:
parent
f6e2dab58a
commit
b7162fab36
1 changed files with 12 additions and 1 deletions
|
@ -790,6 +790,17 @@ class Torrent(object):
|
||||||
"""
|
"""
|
||||||
return self.handle.queue_position()
|
return self.handle.queue_position()
|
||||||
|
|
||||||
|
def get_file_priorities(self):
|
||||||
|
"""Return the file priorities"""
|
||||||
|
if not self.handle.has_metadata():
|
||||||
|
return []
|
||||||
|
|
||||||
|
if not self.options['file_priorities']:
|
||||||
|
# Ensure file_priorities option is populated.
|
||||||
|
self.set_file_priorities([])
|
||||||
|
|
||||||
|
return self.options['file_priorities']
|
||||||
|
|
||||||
def get_file_progress(self):
|
def get_file_progress(self):
|
||||||
"""Calculates the file progress as a percentage.
|
"""Calculates the file progress as a percentage.
|
||||||
|
|
||||||
|
@ -955,7 +966,7 @@ class Torrent(object):
|
||||||
'storage_mode': lambda: self.status.storage_mode.name.split('_')[2], # sparse or allocate
|
'storage_mode': lambda: self.status.storage_mode.name.split('_')[2], # sparse or allocate
|
||||||
'distributed_copies': lambda: max(0.0, self.status.distributed_copies),
|
'distributed_copies': lambda: max(0.0, self.status.distributed_copies),
|
||||||
'download_payload_rate': lambda: self.status.download_payload_rate,
|
'download_payload_rate': lambda: self.status.download_payload_rate,
|
||||||
'file_priorities': lambda: self.options['file_priorities'],
|
'file_priorities': self.get_file_priorities,
|
||||||
'hash': lambda: self.torrent_id,
|
'hash': lambda: self.torrent_id,
|
||||||
'is_auto_managed': lambda: self.options['auto_managed'],
|
'is_auto_managed': lambda: self.options['auto_managed'],
|
||||||
'is_finished': lambda: self.is_finished,
|
'is_finished': lambda: self.is_finished,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue