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:
Mark McDowall 2014-04-01 13:07:41 -07:00
parent 492ffb5714
commit e21574a203
44 changed files with 567 additions and 81 deletions

View file

@ -6,8 +6,9 @@ define(
'Cells/FileSizeCell',
'Cells/QualityCell',
'Cells/ApprovalStatusCell',
'Release/DownloadReportCell'
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell) {
'Release/DownloadReportCell',
'Release/AgeCell'
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell, AgeCell) {
return Marionette.Layout.extend({
template: 'Episode/Search/ManualLayoutTemplate',
@ -22,7 +23,7 @@ define(
name : 'age',
label : 'Age',
sortable: true,
cell : Backgrid.IntegerCell
cell : AgeCell
},
{
name : 'title',

36
src/UI/Release/AgeCell.js Normal file
View file

@ -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';
}
});
});

View file

@ -61,5 +61,41 @@
</span>
</div>
</div>
<div class="control-group advanced-setting">
<label class="control-label">Grace Period</label>
<div class="controls">
<input type="number" min="1" max="24" name="blacklistGracePeriod"/>
<span class="help-inline">
<i class="icon-nd-form-info" title="Age in hours that a release will remain in the download client and retried"/>
</span>
</div>
</div>
<div class="control-group advanced-setting">
<label class="control-label">Retry Interval</label>
<div class="controls">
<input type="number" min="5" max="120" name="blacklistRetryInterval"/>
<span class="help-inline">
<i class="icon-nd-form-info" title="Time in minutes before a failed download for a recent release will be retried"/>
</span>
</div>
</div>
<div class="control-group advanced-setting">
<label class="control-label">Retry Count</label>
<div class="controls">
<input type="number" min="0" max="10" name="blacklistRetryLimit"/>
<span class="help-inline">
<i class="icon-nd-form-info" title="Number of times to retry a release before it is blacklisted"/>
</span>
</div>
</div>
</div>
</fieldset>