Added option to disable blacklisting, both the queue check and the spec

pull/35/head
Mark McDowall 11 years ago
parent 4578adf1c0
commit 7c6fad155a

@ -275,6 +275,13 @@ namespace NzbDrone.Core.Configuration
set { SetValue("RemoveFailedDownloads", value); }
}
public Boolean EnableFailedDownloadHandling
{
get { return GetValueBoolean("EnableFailedDownloadHandling", true); }
set { SetValue("EnableFailedDownloadHandling", value); }
}
public string DownloadClientWorkingFolders
{
get { return GetValue("DownloadClientWorkingFolders", "_UNPACK_|_FAILED_"); }

@ -41,6 +41,7 @@ namespace NzbDrone.Core.Configuration
String DownloadClientWorkingFolders { get; set; }
Boolean AutoRedownloadFailed { get; set; }
Boolean RemoveFailedDownloads { get; set; }
Boolean EnableFailedDownloadHandling { get; set; }
void SaveValues(Dictionary<string, object> configValues);
}
}

@ -1,6 +1,7 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
@ -9,11 +10,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public class BlacklistSpecification : IDecisionEngineSpecification
{
private readonly IBlacklistService _blacklistService;
private readonly IConfigService _configService;
private readonly Logger _logger;
public BlacklistSpecification(IBlacklistService blacklistService, Logger logger)
public BlacklistSpecification(IBlacklistService blacklistService, IConfigService configService, Logger logger)
{
_blacklistService = blacklistService;
_configService = configService;
_logger = logger;
}
@ -27,9 +30,15 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
{
if (!_configService.EnableFailedDownloadHandling)
{
_logger.Trace("Failed Download Handling is not enabled");
return true;
}
if (_blacklistService.Blacklisted(subject.Release.Title))
{
_logger.Trace("Release is blacklisted");
_logger.Trace("{0} is blacklisted", subject.Release.Title);
return false;
}

@ -39,6 +39,12 @@ namespace NzbDrone.Core.Download
private void CheckForFailedDownloads()
{
if (!_configService.EnableFailedDownloadHandling)
{
_logger.Trace("Failed Download Handling is not enabled");
return;
}
var grabbedHistory = _historyService.Grabbed();
var failedHistory = _historyService.Failed();

@ -10,11 +10,28 @@ define(
template: 'Settings/MediaManagement/FileManagement/FileManagementViewTemplate',
ui: {
recyclingBin: '.x-path'
recyclingBin : '.x-path',
failedDownloadHandlingCheckbox: '.x-failed-download-handling',
failedDownloadOptions : '.x-failed-download-options'
},
events: {
'change .x-failed-download-handling': '_setFailedDownloadOptionsVisibility'
},
onShow: function () {
this.ui.recyclingBin.autoComplete('/directories');
},
_setFailedDownloadOptionsVisibility: function () {
var checked = this.ui.failedDownloadHandlingCheckbox.prop('checked');
if (checked) {
this.ui.failedDownloadOptions.slideDown();
}
else {
this.ui.failedDownloadOptions.slideUp();
}
}
});

@ -56,6 +56,27 @@
<fieldset class="advanced-setting">
<legend>Failed Download Handling</legend>
<div class="control-group">
<label class="control-label">Enable</label>
<div class="controls">
<label class="checkbox toggle well">
<input type="checkbox" name="enableFailedDownloadHandling" class="x-failed-download-handling"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Process failed downloads and blacklist the release"/>
</span>
</div>
</div>
<div class="x-failed-download-options">
<div class="control-group">
<label class="control-label">Redownload</label>
@ -95,4 +116,5 @@
</span>
</div>
</div>
</div>
</fieldset>

@ -17,7 +17,7 @@ define(
},
events: {
'change .x-rename-episodes': '_setNamingOptionsVisibility'
'change .x-rename-episodes': '_setFailedDownloadOptionsVisibility'
},
onRender: function () {
@ -32,7 +32,7 @@ define(
this._updateSamples();
},
_setNamingOptionsVisibility: function () {
_setFailedDownloadOptionsVisibility: function () {
var checked = this.ui.renameEpisodesCheckbox.prop('checked');
if (checked) {
this.ui.namingOptions.slideDown();

Loading…
Cancel
Save