mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 23:18:40 +00:00
Feature #1308: Add Seeds/Peers ratio to torrent list view
This commit is contained in:
parent
766c48e3ca
commit
b93477c41e
2 changed files with 10 additions and 0 deletions
|
@ -572,6 +572,13 @@ class Torrent(object):
|
||||||
if distributed_copies < 0:
|
if distributed_copies < 0:
|
||||||
distributed_copies = 0.0
|
distributed_copies = 0.0
|
||||||
|
|
||||||
|
# Calculate the seeds:peers ratio
|
||||||
|
if self.status.num_incomplete == 0:
|
||||||
|
# Use -1.0 to signify infinity
|
||||||
|
seeds_peers_ratio = -1.0
|
||||||
|
else:
|
||||||
|
seeds_peers_ratio = self.status.num_complete / float(self.status.num_incomplete)
|
||||||
|
|
||||||
#if you add a key here->add it to core.py STATUS_KEYS too.
|
#if you add a key here->add it to core.py STATUS_KEYS too.
|
||||||
full_status = {
|
full_status = {
|
||||||
"active_time": self.status.active_time,
|
"active_time": self.status.active_time,
|
||||||
|
@ -601,6 +608,7 @@ class Torrent(object):
|
||||||
"remove_at_ratio": self.options["remove_at_ratio"],
|
"remove_at_ratio": self.options["remove_at_ratio"],
|
||||||
"save_path": self.options["download_location"],
|
"save_path": self.options["download_location"],
|
||||||
"seeding_time": self.status.seeding_time,
|
"seeding_time": self.status.seeding_time,
|
||||||
|
"seeds_peers_ratio": seeds_peers_ratio,
|
||||||
"seed_rank": self.status.seed_rank,
|
"seed_rank": self.status.seed_rank,
|
||||||
"state": self.state,
|
"state": self.state,
|
||||||
"stop_at_ratio": self.options["stop_at_ratio"],
|
"stop_at_ratio": self.options["stop_at_ratio"],
|
||||||
|
|
|
@ -231,6 +231,8 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
self.add_func_column(_("Peers"), listview.cell_data_peer, [int, int],
|
self.add_func_column(_("Peers"), listview.cell_data_peer, [int, int],
|
||||||
status_field=["num_peers", "total_peers"],
|
status_field=["num_peers", "total_peers"],
|
||||||
sort_func=seed_peer_column_sort)
|
sort_func=seed_peer_column_sort)
|
||||||
|
self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float],
|
||||||
|
status_field=["seeds_peers_ratio"])
|
||||||
self.add_func_column(_("Down Speed"), listview.cell_data_speed, [float],
|
self.add_func_column(_("Down Speed"), listview.cell_data_speed, [float],
|
||||||
status_field=["download_payload_rate"])
|
status_field=["download_payload_rate"])
|
||||||
self.add_func_column(_("Up Speed"), listview.cell_data_speed, [float],
|
self.add_func_column(_("Up Speed"), listview.cell_data_speed, [float],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue