mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 12:04:10 +00:00
Fix display of availability.
This commit is contained in:
parent
2707afc9c8
commit
8e96afe626
@ -115,14 +115,19 @@ class Torrent:
|
||||
state = status.state
|
||||
if status.paused:
|
||||
state = deluge.common.TORRENT_STATE.index("Paused")
|
||||
|
||||
|
||||
# Adjust status.distributed_copies to return a non-negative value
|
||||
distributed_copies = status.distributed_copies
|
||||
if distributed_copies < 0:
|
||||
distributed_copies = 0.0
|
||||
|
||||
full_status = {
|
||||
"name": self.handle.torrent_info().name(),
|
||||
"total_size": self.handle.torrent_info().total_size(),
|
||||
"num_files": self.handle.torrent_info().num_files(),
|
||||
"num_pieces": self.handle.torrent_info().num_pieces(),
|
||||
"piece_length": self.handle.torrent_info().piece_length(),
|
||||
"distributed_copies": status.distributed_copies,
|
||||
"distributed_copies": distributed_copies,
|
||||
"total_done": status.total_done,
|
||||
"total_uploaded": self.total_uploaded + status.total_payload_upload,
|
||||
"state": int(state),
|
||||
|
Loading…
x
Reference in New Issue
Block a user