Allow Hardcoded subs to be downloaded still.

pull/2/head
Leonardo Galli 8 years ago
parent b4bb8875d3
commit 7066b078ab

@ -9,6 +9,7 @@ namespace NzbDrone.Api.Config
public int Retention { get; set; }
public int RssSyncInterval { get; set; }
public int AvailabilityDelay { get; set; }
public bool AllowHardcodedSubs { get; set; }
}
public static class IndexerConfigResourceMapper
@ -21,6 +22,7 @@ namespace NzbDrone.Api.Config
Retention = model.Retention,
RssSyncInterval = model.RssSyncInterval,
AvailabilityDelay = model.AvailabilityDelay,
AllowHardcodedSubs = model.AllowHardcodedSubs,
};
}
}

@ -190,6 +190,13 @@ namespace NzbDrone.Core.Configuration
set { SetValue("EnableCompletedDownloadHandling", value); }
}
public bool AllowHardcodedSubs
{
get { return GetValueBoolean("AllowHardcodedSubs", false); }
set { SetValue("AllowHardcodedSubs", value); }
}
public bool RemoveCompletedDownloads
{
get { return GetValueBoolean("RemoveCompletedDownloads", false); }

@ -48,6 +48,8 @@ namespace NzbDrone.Core.Configuration
int AvailabilityDelay { get; set; }
bool AllowHardcodedSubs { get; set; }
int NetImportSyncInterval { get; set; }
string ListSyncLevel { get; set; }
string ImportExclusions { get; set; }

@ -5,6 +5,7 @@ using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
@ -21,12 +22,14 @@ namespace NzbDrone.Core.DecisionEngine
{
private readonly IEnumerable<IDecisionEngineSpecification> _specifications;
private readonly IParsingService _parsingService;
private readonly IConfigService _configService;
private readonly Logger _logger;
public DownloadDecisionMaker(IEnumerable<IDecisionEngineSpecification> specifications, IParsingService parsingService, Logger logger)
public DownloadDecisionMaker(IEnumerable<IDecisionEngineSpecification> specifications, IParsingService parsingService, IConfigService configService, Logger logger)
{
_specifications = specifications;
_parsingService = parsingService;
_configService = configService;
_logger = logger;
}
@ -82,7 +85,14 @@ namespace NzbDrone.Core.DecisionEngine
if (parsedMovieInfo.Quality.HardcodedSubs.IsNotNullOrWhiteSpace())
{
remoteMovie.DownloadAllowed = true;
decision = new DownloadDecision(remoteMovie, new Rejection("Hardcoded subs found: " + parsedMovieInfo.Quality.HardcodedSubs));
if (_configService.AllowHardcodedSubs)
{
decision = GetDecisionForReport(remoteMovie, searchCriteria);
}
else
{
decision = new DownloadDecision(remoteMovie, new Rejection("Hardcoded subs found: " + parsedMovieInfo.Quality.HardcodedSubs));
}
}
else
{

@ -37,6 +37,28 @@
<input type="number" name="rssSyncInterval" class="form-control" min="0" max="720"/>
</div>
</div>
<div class="form-group advanced-setting">
<label class="col-sm-3 control-label">Allow Hardcoded Subs</label>
<div class="col-sm-1 col-sm-push-2 help-inline">
<i class="icon-sonarr-form-info" title="If set to yes, all detected hardcoded subs will be downloaded automatically."/>
</div>
<div class="col-sm-2 col-sm-pull-1">
<div class="input-group">
<label class="checkbox toggle well">
<input type="checkbox" name="allowHardcodedSubs" class="x-completed-download-handling"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
</div>
</div>
</div>
<legend>Availability Options</legend>
<div class="form-group">
<label class="col-sm-3 control-label">Availability Delay</label>

Loading…
Cancel
Save