From 141d254f358d0fa6ae26ff60b013056896d997f0 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 1 Apr 2009 21:53:41 +0000 Subject: [PATCH] tweak the seeds and peers renderers to match the gtk ones --- deluge/ui/web/js/deluge-torrents.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/deluge-torrents.js b/deluge/ui/web/js/deluge-torrents.js index 7e9593f2c..8f12147e9 100644 --- a/deluge/ui/web/js/deluge-torrents.js +++ b/deluge/ui/web/js/deluge-torrents.js @@ -53,11 +53,19 @@ function progress(value, p, r) { } function seeds(value, p, r) { - return String.format("{0} ({1})", value, r.data['total_seeds']); + if (r.data['total_seeds'] > -1) { + return String.format("{0} ({1})", value, r.data['total_seeds']); + } else { + return value; + } } function peers(value, p, r) { - return String.format("{0} ({1})", value, r.data['total_peers']); + if (r.data['total_peers'] > -1) { + return String.format("{0} ({1})", value, r.data['total_peers']); + } else { + return value; + } } function avail(value) {