mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 12:34:43 +00:00
Fix displaying file percentages properly.
This commit is contained in:
parent
a2b2b4c3f4
commit
31bb4eface
@ -366,6 +366,15 @@ class Torrent:
|
||||
"""Returns the torrents queue position"""
|
||||
return self.handle.queue_position()
|
||||
|
||||
def get_file_progress(self):
|
||||
"""Returns the file progress as a list of floats.. 0.0 -> 1.0"""
|
||||
file_progress = self.handle.file_progress()
|
||||
ret = []
|
||||
for i,f in enumerate(self.files):
|
||||
ret.append(file_progress[i] / f["size"])
|
||||
|
||||
return ret
|
||||
|
||||
def get_status(self, keys):
|
||||
"""Returns the status of the torrent based on the keys provided"""
|
||||
# Create the full dictionary
|
||||
@ -429,7 +438,7 @@ class Torrent:
|
||||
"piece_length": self.torrent_info.piece_length,
|
||||
"eta": self.get_eta,
|
||||
"ratio": self.get_ratio,
|
||||
"file_progress": self.handle.file_progress,
|
||||
"file_progress": self.get_file_progress,
|
||||
"queue": self.handle.queue_position,
|
||||
"is_seed": self.handle.is_seed,
|
||||
"peers": self.get_peers,
|
||||
|
Loading…
x
Reference in New Issue
Block a user