From a40b8e4d509e528e085468c59cb397eda09bf8b4 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 8 Jun 2007 08:49:24 +0000 Subject: [PATCH] details stats fixes --- src/core.py | 2 +- src/deluge_core.cpp | 7 ++++--- src/interface.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core.py b/src/core.py index 1f2731799..13334ef85 100644 --- a/src/core.py +++ b/src/core.py @@ -718,7 +718,7 @@ class Manager: def calc_ratio(self, unique_ID, torrent_state): 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: ret = float(up/down) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index e4ecfef2c..e3212f3ae 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -620,7 +620,7 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args) 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(), "num_files", t.handle.get_torrent_info().num_files(), "state", s.state, @@ -628,9 +628,9 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args) "num_seeds", connected_seeds, "distributed_copies", s.distributed_copies, "download_rate", s.download_rate, - "total_download", double(s.total_download), + "total_download", int(s.total_download), "upload_rate", s.upload_rate, - "total_upload", long(s.total_upload), + "total_upload", int(s.total_upload), "tracker_ok", !s.current_tracker.empty(), "next_announce", boost::posix_time::to_simple_string(s.next_announce).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), "is_paused", long(t.handle.is_paused()), "is_seed", long(t.handle.is_seed()), + "total_done", int(s.total_done), "total_wanted", double(s.total_wanted), "total_wanted_done", double(s.total_wanted_done)); }; diff --git a/src/interface.py b/src/interface.py index 40024ba32..7fd627a1b 100644 --- a/src/interface.py +++ b/src/interface.py @@ -707,8 +707,8 @@ class DelugeGTK: 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_pieces.set_text(str(state["num_pieces"])) - self.text_summary_total_downloaded.set_text(common.fsize(state["total_payload_download"])) - self.text_summary_total_uploaded.set_text(common.fsize(state["total_payload_upload"])) + self.text_summary_total_downloaded.set_text(common.fsize(state["total_done"])) + 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_upload_rate.set_text(common.frate(state["upload_rate"])) self.text_summary_seeders.set_text(common.fseed(state))