diff --git a/src/NzbDrone.Api/Config/IndexerConfigResource.cs b/src/NzbDrone.Api/Config/IndexerConfigResource.cs index 3bd091aa6..10336b303 100644 --- a/src/NzbDrone.Api/Config/IndexerConfigResource.cs +++ b/src/NzbDrone.Api/Config/IndexerConfigResource.cs @@ -10,6 +10,7 @@ namespace NzbDrone.Api.Config public int RssSyncInterval { get; set; } public int AvailabilityDelay { get; set; } public bool AllowHardcodedSubs { get; set; } + public string WhitelistedHardcodedSubs { get; set; } } public static class IndexerConfigResourceMapper @@ -23,6 +24,8 @@ namespace NzbDrone.Api.Config RssSyncInterval = model.RssSyncInterval, AvailabilityDelay = model.AvailabilityDelay, AllowHardcodedSubs = model.AllowHardcodedSubs, + WhitelistedHardcodedSubs = model.WhitelistedHardcodedSubs, + }; } } diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs index 78dcbc8ea..bc6c1f24e 100644 --- a/src/NzbDrone.Core/Configuration/ConfigService.cs +++ b/src/NzbDrone.Core/Configuration/ConfigService.cs @@ -197,6 +197,13 @@ namespace NzbDrone.Core.Configuration set { SetValue("AllowHardcodedSubs", value); } } + public string WhitelistedHardcodedSubs + { + get { return GetValue("WhitelistedHardcodedSubs", ""); } + + set { SetValue("WhitelistedHardcodedSubs", value); } + } + public bool RemoveCompletedDownloads { get { return GetValueBoolean("RemoveCompletedDownloads", false); } diff --git a/src/NzbDrone.Core/Configuration/IConfigService.cs b/src/NzbDrone.Core/Configuration/IConfigService.cs index e6687bf68..3226694d5 100644 --- a/src/NzbDrone.Core/Configuration/IConfigService.cs +++ b/src/NzbDrone.Core/Configuration/IConfigService.cs @@ -49,6 +49,7 @@ namespace NzbDrone.Core.Configuration int AvailabilityDelay { get; set; } bool AllowHardcodedSubs { get; set; } + string WhitelistedHardcodedSubs { get; set; } int NetImportSyncInterval { get; set; } string ListSyncLevel { get; set; } diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index 0a1a18bc4..910cad30b 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -91,7 +91,16 @@ namespace NzbDrone.Core.DecisionEngine } else { - decision = new DownloadDecision(remoteMovie, new Rejection("Hardcoded subs found: " + parsedMovieInfo.Quality.HardcodedSubs)); + var whitelisted = _configService.WhitelistedHardcodedSubs.Split(','); + _logger.Debug("Testing: {0}", whitelisted); + if (whitelisted != null && whitelisted.Any(t => (parsedMovieInfo.Quality.HardcodedSubs.ToLower().Contains(t.ToLower()) && t.IsNotNullOrWhiteSpace()))) + { + decision = GetDecisionForReport(remoteMovie, searchCriteria); + } + else + { + decision = new DownloadDecision(remoteMovie, new Rejection("Hardcoded subs found: " + parsedMovieInfo.Quality.HardcodedSubs)); + } } } else diff --git a/src/UI/Settings/Indexers/Options/IndexerOptionsView.js b/src/UI/Settings/Indexers/Options/IndexerOptionsView.js index 5d4386faa..190920b79 100644 --- a/src/UI/Settings/Indexers/Options/IndexerOptionsView.js +++ b/src/UI/Settings/Indexers/Options/IndexerOptionsView.js @@ -1,12 +1,27 @@ var Marionette = require('marionette'); var AsModelBoundView = require('../../../Mixins/AsModelBoundView'); var AsValidatedView = require('../../../Mixins/AsValidatedView'); +require('../../../Mixins/TagInput'); +require('bootstrap'); +require('bootstrap.tagsinput'); var view = Marionette.ItemView.extend({ - template : 'Settings/Indexers/Options/IndexerOptionsViewTemplate' + template : 'Settings/Indexers/Options/IndexerOptionsViewTemplate', + + ui : { + hcwhitelist : '.x-hcwhitelist', + }, + + onRender : function() { + this.ui.hcwhitelist.tagsinput({ + trimValue : true, + allowDuplicates: true, + tagClass : 'label label-success' + }); + }, }); AsModelBoundView.call(view); AsValidatedView.call(view); -module.exports = view; \ No newline at end of file +module.exports = view; diff --git a/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs b/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs index 0b2408e15..575f7174b 100644 --- a/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs +++ b/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs @@ -38,6 +38,17 @@ +