1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-01-01 04:45:35 +00:00

Allow Hardcoded subs to be downloaded still.

This commit is contained in:
Leonardo Galli 2017-04-10 11:17:31 +02:00
parent b4bb8875d3
commit 7066b078ab
5 changed files with 45 additions and 2 deletions

View file

@ -9,6 +9,7 @@ public class IndexerConfigResource : RestResource
public int Retention { get; set; } public int Retention { get; set; }
public int RssSyncInterval { get; set; } public int RssSyncInterval { get; set; }
public int AvailabilityDelay { get; set; } public int AvailabilityDelay { get; set; }
public bool AllowHardcodedSubs { get; set; }
} }
public static class IndexerConfigResourceMapper public static class IndexerConfigResourceMapper
@ -21,6 +22,7 @@ public static IndexerConfigResource ToResource(IConfigService model)
Retention = model.Retention, Retention = model.Retention,
RssSyncInterval = model.RssSyncInterval, RssSyncInterval = model.RssSyncInterval,
AvailabilityDelay = model.AvailabilityDelay, AvailabilityDelay = model.AvailabilityDelay,
AllowHardcodedSubs = model.AllowHardcodedSubs,
}; };
} }
} }

View file

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

View file

@ -48,6 +48,8 @@ public interface IConfigService
int AvailabilityDelay { get; set; } int AvailabilityDelay { get; set; }
bool AllowHardcodedSubs { get; set; }
int NetImportSyncInterval { get; set; } int NetImportSyncInterval { get; set; }
string ListSyncLevel { get; set; } string ListSyncLevel { get; set; }
string ImportExclusions { get; set; } string ImportExclusions { get; set; }

View file

@ -5,6 +5,7 @@
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions; using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Common.Serializer; using NzbDrone.Common.Serializer;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
@ -21,12 +22,14 @@ public class DownloadDecisionMaker : IMakeDownloadDecision
{ {
private readonly IEnumerable<IDecisionEngineSpecification> _specifications; private readonly IEnumerable<IDecisionEngineSpecification> _specifications;
private readonly IParsingService _parsingService; private readonly IParsingService _parsingService;
private readonly IConfigService _configService;
private readonly Logger _logger; 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; _specifications = specifications;
_parsingService = parsingService; _parsingService = parsingService;
_configService = configService;
_logger = logger; _logger = logger;
} }
@ -82,7 +85,14 @@ private IEnumerable<DownloadDecision> GetMovieDecisions(List<ReleaseInfo> report
if (parsedMovieInfo.Quality.HardcodedSubs.IsNotNullOrWhiteSpace()) if (parsedMovieInfo.Quality.HardcodedSubs.IsNotNullOrWhiteSpace())
{ {
remoteMovie.DownloadAllowed = true; 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 else
{ {

View file

@ -37,6 +37,28 @@
<input type="number" name="rssSyncInterval" class="form-control" min="0" max="720"/> <input type="number" name="rssSyncInterval" class="form-control" min="0" max="720"/>
</div> </div>
</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> <legend>Availability Options</legend>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">Availability Delay</label> <label class="col-sm-3 control-label">Availability Delay</label>