From c04de8da642a1dd89767e97fa80fa271719a34bb Mon Sep 17 00:00:00 2001 From: "Brian G. Olson" Date: Mon, 15 Jun 2015 01:46:46 -0500 Subject: [PATCH] Show number of seeders along with number of connections. For downloads that have seeders show "Connections (Seeders)" in the connections button, otherwise show "Connections" --- index.html | 2 +- js/ctrls/main.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index bf7d97c..6dbb6b4 100755 --- a/index.html +++ b/index.html @@ -577,7 +577,7 @@
  •   {{download.fmtUploadSpeed}}
  •   {{download.fmtUploadLength}}
  • -
  •   {{download.connections}}
  • +
  •   {{download.connections}}{{download.numSeeders}}
  •   {{download.gid}}
  • # of   {{download.numPieces}}
  • diff --git a/js/ctrls/main.js b/js/ctrls/main.js index bb5dcba..ebe4735 100755 --- a/js/ctrls/main.js +++ b/js/ctrls/main.js @@ -378,6 +378,8 @@ function( followedFrom: null, numPieces: d.numPieces, connections: d.connections, + connectionsTitle: "Connections", + numSeeders: d.numSeeders, bitfield: d.bitfield, errorCode: d.errorCode, totalLength: d.totalLength, @@ -407,6 +409,13 @@ function( ctx.followedFrom = null; ctx.numPieces = d.numPieces; ctx.connections = d.connections; + if ( typeof d.numSeeders === 'undefined' ) { + ctx.numSeeders = ""; + } + else { + ctx.connectionsTitle = "Connections (Seeders)"; + ctx.numSeeders = " (" + d.numSeeders + ")"; + } ctx.bitfield = d.bitfield; if (ctx.totalLength !== d.totalLength) { ctx.totalLength = d.totalLength;