Show number of seeders along with number of connections.

For downloads that have seeders show "Connections (Seeders)" in the
connections button, otherwise show "Connections"
This commit is contained in:
Brian G. Olson 2015-06-15 01:46:46 -05:00
parent 96b882f75a
commit c04de8da64
2 changed files with 10 additions and 1 deletions

View File

@ -577,7 +577,7 @@
<li class="label label-default" title="Upload Speed" ng-show="download.bittorrent"><i class="fa fa-fw fa-arrow-circle-o-up">&nbsp;</i> <span class="download-uploadSpeed">{{download.fmtUploadSpeed}}</span></li>
<li class="label label-default" title="Uploaded" ng-show="download.bittorrent"><i class="fa fa-fw fa-upload">&nbsp;</i> <span class="download-uploadLength">{{download.fmtUploadLength}}</span></li>
<li class="label label-default" title="Connections"><i class="fa fa-fw fa-link">&nbsp;</i> <span class="download-connections">{{download.connections}}</span></li>
<li class="label label-default" title={{download.connectionsTitle}}><i class="fa fa-fw fa-link">&nbsp;</i> <span class="download-connections">{{download.connections}}{{download.numSeeders}}</span></li>
<li class="label label-default" title="Download GID"><i class="fa fa-fw fa-bars">&nbsp;</i> <span class="download-gid">{{download.gid}}</span></li>
<li class="label label-default" title="Number of Pieces"># of <i class="fa fa-fw fa-puzzle-piece">&nbsp;</i> <span class="download-numPieces">{{download.numPieces}}</span></li>

View File

@ -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;