New: Rebuilt Completed/Failed download handling from scratch

This commit is contained in:
Keivan Beigi
2014-12-18 16:26:42 -08:00
parent 264bb66c16
commit a6d34caf2c
79 changed files with 1221 additions and 2389 deletions
@@ -12,20 +12,20 @@ define(
ui: {
completedDownloadHandlingCheckbox : '.x-completed-download-handling',
completedDownloadOptions : '.x-completed-download-options',
failedDownloadHandlingCheckbox : '.x-failed-download-handling',
failedAutoRedownladCheckbox : '.x-failed-auto-redownload',
failedDownloadOptions : '.x-failed-download-options'
},
events: {
'change .x-completed-download-handling' : '_setCompletedDownloadOptionsVisibility',
'change .x-failed-download-handling' : '_setFailedDownloadOptionsVisibility'
'change .x-failed-auto-redownload' : '_setFailedDownloadOptionsVisibility'
},
onRender: function () {
if (!this.ui.completedDownloadHandlingCheckbox.prop('checked')) {
this.ui.completedDownloadOptions.hide();
}
if (!this.ui.failedDownloadHandlingCheckbox.prop('checked')) {
if (!this.ui.failedAutoRedownladCheckbox.prop('checked')) {
this.ui.failedDownloadOptions.hide();
}
},
@@ -42,7 +42,7 @@ define(
},
_setFailedDownloadOptionsVisibility: function () {
var checked = this.ui.failedDownloadHandlingCheckbox.prop('checked');
var checked = this.ui.failedAutoRedownladCheckbox.prop('checked');
if (checked) {
this.ui.failedDownloadOptions.slideDown();
}
@@ -14,15 +14,13 @@
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Import completed downloads in download client history"/>
<i class="icon-nd-form-warning" title="Download client history items that are stored in the drone factory will be ignored. Configure the Drone Factory for a different path"/>
<i class="icon-nd-form-info" title="Automatically import completed downloads from download client"/>
</span>
</div>
</div>
</div>
</div>
<div class="x-completed-download-options advanced-setting">
<div class="form-group">
<label class="col-sm-3 control-label">Remove</label>
@@ -44,20 +42,19 @@
</span>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset class="advanced-setting">
<fieldset>
<legend>Failed Download Handling</legend>
<div class="form-group">
<label class="col-sm-3 control-label">Enable</label>
<label class="col-sm-3 control-label">Redownload</label>
<div class="col-sm-8">
<div class="input-group">
<label class="checkbox toggle well">
<input type="checkbox" name="enableFailedDownloadHandling" class="x-failed-download-handling"/>
<input type="checkbox" name="autoRedownloadFailed" class="x-failed-auto-redownload"/>
<p>
<span>Yes</span>
<span>No</span>
@@ -66,39 +63,15 @@
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Process failed downloads and blacklist the release"/>
</span>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Automatically search for and attempt to download a different release"/>
</span>
</div>
</div>
</div>
<div class="x-failed-download-options">
<div class="form-group">
<label class="col-sm-3 control-label">Redownload</label>
<div class="col-sm-8">
<div class="input-group">
<label class="checkbox toggle well">
<input type="checkbox" name="autoRedownloadFailed"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Automatically search for and attempt to download another release"/>
</span>
</div>
</div>
</div>
<div class="form-group">
<div class="x-failed-download-options advanced-setting">
<div class="form-group ">
<label class="col-sm-3 control-label">Remove</label>
<div class="col-sm-8">
<div class="input-group">
<label class="checkbox toggle well">
@@ -110,48 +83,11 @@
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Remove failed downloads from download client history"/>
</span>
</div>
</div>
</div>
<div class="form-group advanced-setting">
<label class="col-sm-3 control-label">Grace Period</label>
<div class="col-sm-1 col-sm-push-2 help-inline">
<i class="icon-nd-form-info" title="Age in hours (since posting) where a release can be retried instead of immediately blacklisted"/>
</div>
<div class="col-sm-2 col-sm-pull-1">
<input type="number" min="1" max="24" name="blacklistGracePeriod" class="form-control"/>
</div>
</div>
<div class="form-group advanced-setting">
<label class="col-sm-3 control-label">Retry Interval</label>
<div class="col-sm-1 col-sm-push-2 help-inline">
<i class="icon-nd-form-info" title="Time in minutes before a failed download for a recent release will be retried"/>
</div>
<div class="col-sm-2 col-sm-pull-1">
<input type="number" min="5" max="120" name="blacklistRetryInterval" class="form-control"/>
</div>
</div>
<div class="form-group advanced-setting">
<label class="col-sm-3 control-label">Retry Count</label>
<div class="col-sm-1 col-sm-push-2 help-inline">
<i class="icon-nd-form-info" title="Number of times to retry a release before it is blacklisted"/>
</div>
<div class="col-sm-2 col-sm-pull-1">
<input type="number" min="0" max="10" name="blacklistRetryLimit" class="form-control"/>
</div>
</div>
</div>
</fieldset>
@@ -1,11 +1,12 @@
<fieldset>
<fieldset class="advanced-setting">
<legend>Drone Factory Options</legend>
<div class="form-group">
<label class="col-sm-3 control-label">Drone Factory</label>
<div class="col-sm-1 col-sm-push-8 help-inline">
<i class="icon-nd-form-info" title="Optional folder to periodically scan for available imports"/>
<i class="icon-nd-form-info" title="Optional folder to periodically scan for possible imports"/>
<i class="icon-nd-form-warning" title="Do not use the folder that contains some or all of your sorted and named TV shows - doing so could cause data loss"></i>
<i class="icon-nd-form-warning" title="Download client history items that are stored in the drone factory will be ignored."/>
</div>
<div class="col-sm-8 col-sm-pull-1">
@@ -13,7 +14,7 @@
</div>
</div>
<div class="form-group advanced-setting">
<div class="form-group">
<label class="col-sm-3 control-label">Drone Factory Interval</label>
<div class="col-sm-1 col-sm-push-2 help-inline">