From f8f5fa930fa103bfdf2681581a6536d837fa2634 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 7 Oct 2012 16:33:55 +0000 Subject: [PATCH] (trunk, web) #5072 "web client doesn't show webseed count" -- pluralization refinement to r13551 --- web/javascript/torrent-row.js | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/web/javascript/torrent-row.js b/web/javascript/torrent-row.js index 7ce4a0229..1e761cced 100644 --- a/web/javascript/torrent-row.js +++ b/web/javascript/torrent-row.js @@ -148,21 +148,33 @@ TorrentRendererFull.prototype = getPeerDetails: function(t) { - var err; + var err, webseed_count; + if ((err = t.getErrorMessage())) return err; if (t.isDownloading()) - return [ 'Downloading from', - t.getPeersSendingToUs(), - 'of', - t.getPeersConnected(), - 'peers', - ' and ', - t.getWebseedsSendingToUs(), - 'webseeds', - TorrentRendererHelper.formatDL(t), - TorrentRendererHelper.formatUL(t) ].join(' '); + { + webseed_count = t.getWebseedsSendingToUs(); + + if (webseed_count) + { + return [ 'Downloading from', + t.getPeersSendingToUs(), + 'of', + t.getPeersConnected(), + 'peers and', + Transmission.fmt.plural (webseed_count, 'webseed') ].join(' '); + } + else + { + return [ 'Downloading from', + t.getPeersSendingToUs(), + 'of', + t.getPeersConnected(), + 'peers' ].join(' '); + } + } if (t.isSeeding()) return [ 'Seeding to',