mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: releases with unknown seeders show on the UI as - instead of 0 to be easier to distinguish.
This commit is contained in:
parent
475c99d492
commit
63e0eba02f
@ -5,8 +5,8 @@ module.exports = Backgrid.Cell.extend({
|
|||||||
|
|
||||||
render : function() {
|
render : function() {
|
||||||
if (this.model.get('protocol') === 'torrent') {
|
if (this.model.get('protocol') === 'torrent') {
|
||||||
var seeders = this.model.get('seeders') || 0;
|
var seeders = this.model.get('seeders');
|
||||||
var leechers = this.model.get('leechers') || 0;
|
var leechers = this.model.get('leechers');
|
||||||
|
|
||||||
var level = 'danger';
|
var level = 'danger';
|
||||||
|
|
||||||
@ -18,7 +18,19 @@ module.exports = Backgrid.Cell.extend({
|
|||||||
level = 'primary';
|
level = 'primary';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$el.html('<div class="label label-{2}" title="{0} seeders, {1} leechers">{0} / {1}</div>'.format(seeders, leechers, level));
|
var txtSeeders = seeders;
|
||||||
|
var txtLeechers = leechers;
|
||||||
|
if (typeof seeders === 'undefined') {
|
||||||
|
txtSeeders = 'unknown';
|
||||||
|
seeders = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof leechers === 'undefined') {
|
||||||
|
txtLeechers = 'unknown';
|
||||||
|
leechers = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$el.html('<div class="label label-{0}" title="{1} seeders, {2} leechers">{3} / {4}</div>'.format(level, txtSeeders, txtLeechers, seeders, leechers));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.delegateEvents();
|
this.delegateEvents();
|
||||||
|
Loading…
Reference in New Issue
Block a user