mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
Blacklisting improvements
New: New releases that fail will be retried a second time after waiting 1hr (configurable) Fixed: Blacklisting releases with the same date and vastly different ages
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'backgrid',
|
||||
'Shared/FormatHelpers'
|
||||
], function (Backgrid, FormatHelpers) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'age-cell',
|
||||
|
||||
render: function () {
|
||||
var age = this.model.get('age');
|
||||
var ageHours = this.model.get('ageHours');
|
||||
|
||||
if (age === 0) {
|
||||
this.$el.html('{0} {1}'.format(ageHours.toFixed(1), this.plural(Math.round(ageHours), 'hour')));
|
||||
}
|
||||
|
||||
else {
|
||||
this.$el.html('{0} {1}'.format(age, this.plural(age, 'day')));
|
||||
}
|
||||
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
|
||||
plural: function (input, unit) {
|
||||
if (input === 1) {
|
||||
return unit;
|
||||
}
|
||||
|
||||
return unit + 's';
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user