details stats fixes
This commit is contained in:
parent
2cc373e5fe
commit
a40b8e4d50
|
@ -718,7 +718,7 @@ class Manager:
|
||||||
|
|
||||||
def calc_ratio(self, unique_ID, torrent_state):
|
def calc_ratio(self, unique_ID, torrent_state):
|
||||||
up = float(torrent_state['total_payload_upload'] + self.unique_IDs[unique_ID].uploaded_memory)
|
up = float(torrent_state['total_payload_upload'] + self.unique_IDs[unique_ID].uploaded_memory)
|
||||||
down = float(torrent_state["total_payload_download"])
|
down = float(torrent_state["total_done"])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = float(up/down)
|
ret = float(up/down)
|
||||||
|
|
|
@ -620,7 +620,7 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args)
|
||||||
|
|
||||||
long connected_peers = s.num_peers - connected_seeds;
|
long connected_peers = s.num_peers - connected_seeds;
|
||||||
|
|
||||||
return Py_BuildValue("{s:s,s:l,s:l,s:l,s:l,s:f,s:f,s:d,s:f,s:l,s:l,s:s,s:s,s:f,s:i,s:i,s:l,s:l,s:l,s:d,s:l,s:l,s:l,s:l,s:l,s:l,s:d,s:d}",
|
return Py_BuildValue("{s:s,s:l,s:l,s:l,s:l,s:f,s:f,s:i,s:f,s:i,s:l,s:s,s:s,s:f,s:i,s:i,s:l,s:l,s:l,s:d,s:l,s:l,s:l,s:l,s:l,s:l,s:i,s:d,s:d}",
|
||||||
"name", t.handle.get_torrent_info().name().c_str(),
|
"name", t.handle.get_torrent_info().name().c_str(),
|
||||||
"num_files", t.handle.get_torrent_info().num_files(),
|
"num_files", t.handle.get_torrent_info().num_files(),
|
||||||
"state", s.state,
|
"state", s.state,
|
||||||
|
@ -628,9 +628,9 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args)
|
||||||
"num_seeds", connected_seeds,
|
"num_seeds", connected_seeds,
|
||||||
"distributed_copies", s.distributed_copies,
|
"distributed_copies", s.distributed_copies,
|
||||||
"download_rate", s.download_rate,
|
"download_rate", s.download_rate,
|
||||||
"total_download", double(s.total_download),
|
"total_download", int(s.total_download),
|
||||||
"upload_rate", s.upload_rate,
|
"upload_rate", s.upload_rate,
|
||||||
"total_upload", long(s.total_upload),
|
"total_upload", int(s.total_upload),
|
||||||
"tracker_ok", !s.current_tracker.empty(),
|
"tracker_ok", !s.current_tracker.empty(),
|
||||||
"next_announce", boost::posix_time::to_simple_string(s.next_announce).c_str(),
|
"next_announce", boost::posix_time::to_simple_string(s.next_announce).c_str(),
|
||||||
"tracker", s.current_tracker.c_str(),
|
"tracker", s.current_tracker.c_str(),
|
||||||
|
@ -647,6 +647,7 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args)
|
||||||
"total_seeds", long(s.num_complete != -1? s.num_complete : connected_seeds),
|
"total_seeds", long(s.num_complete != -1? s.num_complete : connected_seeds),
|
||||||
"is_paused", long(t.handle.is_paused()),
|
"is_paused", long(t.handle.is_paused()),
|
||||||
"is_seed", long(t.handle.is_seed()),
|
"is_seed", long(t.handle.is_seed()),
|
||||||
|
"total_done", int(s.total_done),
|
||||||
"total_wanted", double(s.total_wanted),
|
"total_wanted", double(s.total_wanted),
|
||||||
"total_wanted_done", double(s.total_wanted_done));
|
"total_wanted_done", double(s.total_wanted_done));
|
||||||
};
|
};
|
||||||
|
|
|
@ -707,8 +707,8 @@ class DelugeGTK:
|
||||||
self.wtree.get_widget("summary_name").set_text(state['name'])
|
self.wtree.get_widget("summary_name").set_text(state['name'])
|
||||||
self.text_summary_total_size.set_text(common.fsize(state["total_size"]))
|
self.text_summary_total_size.set_text(common.fsize(state["total_size"]))
|
||||||
self.text_summary_pieces.set_text(str(state["num_pieces"]))
|
self.text_summary_pieces.set_text(str(state["num_pieces"]))
|
||||||
self.text_summary_total_downloaded.set_text(common.fsize(state["total_payload_download"]))
|
self.text_summary_total_downloaded.set_text(common.fsize(state["total_done"]))
|
||||||
self.text_summary_total_uploaded.set_text(common.fsize(state["total_payload_upload"]))
|
self.text_summary_total_uploaded.set_text(common.fsize(self.manager.unique_IDs[self.get_selected_torrent()].uploaded_memory))
|
||||||
self.text_summary_download_rate.set_text(common.frate(state["download_rate"]))
|
self.text_summary_download_rate.set_text(common.frate(state["download_rate"]))
|
||||||
self.text_summary_upload_rate.set_text(common.frate(state["upload_rate"]))
|
self.text_summary_upload_rate.set_text(common.frate(state["upload_rate"]))
|
||||||
self.text_summary_seeders.set_text(common.fseed(state))
|
self.text_summary_seeders.set_text(common.fseed(state))
|
||||||
|
|
Loading…
Reference in New Issue