Misc Settings

This commit is contained in:
Mark McDowall 2013-03-18 08:25:36 -07:00
parent 15bbeb9270
commit b87f2a22da
6 changed files with 83 additions and 18 deletions

View File

@ -5,6 +5,14 @@
cursor: default;
}
.form-horizontal .controls i.warning {
color: #F89406;
}
.form-horizontal .controls i.danger {
color: #B94A48;
}
.help-inline-checkbox {
float: left;
padding-left: 7px;
@ -14,3 +22,13 @@
.switch {
float: left;
}
textarea.nzb-restrictions {
width: 260px;
}
.text-area-help {
display: block;
color: #777777;
font-size: 12px;
}

View File

@ -1,3 +1,40 @@
<div>
Misc settings will go here
<fieldset>
<legend>General</legend>
<div class="control-group">
<label class="control-label">Backlog Searching</label>
<div class="controls">
<div class="switch">
<input type="checkbox" name="enableBacklogSearching" />
</div>
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Should NzbDrone try to download missing episodes automatically?"></i>
<i class="icon-exclamation-sign danger" title="Enabling backlog searching can use a lot of bandwidth and is not
recommended for users with block usenet accounts or bandwidth restrictions."></i>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Ignore Deleted Episodes</label>
<div class="controls">
<div class="switch">
<input type="checkbox" name="autoIgnorePreviouslyDownloadedEpisodes" />
</div>
<span class="help-inline-checkbox">
<i class="icon-question-sign" title="Episodes deleted from disk are automatically ignored in NzbDrone"></i>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Nzb Restrictions</label>
<div class="controls">
<textarea rows="3" name="nzbRestrictions" class="nzb-restrictions"></textarea>
<span class="help-inline">
<i class="icon-question-sign" title="White list or black list nzbs based on these rules<br/>White list: +:LoL<br/>Black list: -:French"></i>
</span>
<span class="text-area-help">Newline-delimited set of rules in the form of +|-:</span>
</div>
</div>
</fieldset>

View File

@ -7,9 +7,17 @@ define([
NzbDrone.Settings.Misc.MiscView = Backbone.Marionette.ItemView.extend({
template: 'Settings/Misc/MiscTemplate',
className: 'form-horizontal',
ui: {
switch: '.switch',
tooltip: '[class^="help-inline"] i'
},
onRender: function () {
NzbDrone.ModelBinder.bind(this.model, this.el);
this.ui.switch.bootstrapSwitch();
this.ui.tooltip.tooltip({ placement: 'right', html: true });
}
});
});

View File

@ -149,7 +149,6 @@ namespace NzbDrone.Core.Configuration
set { SetValue("DownloadClientTvDirectory", value); }
}
public bool UseSeasonFolder
{
get { return GetValueBoolean("UseSeasonFolder", true); }
@ -373,12 +372,6 @@ namespace NzbDrone.Core.Configuration
set { SetValue("MetadataUseBanners", value); }
}
public string AllowedReleaseGroups
{
get { return GetValue("AllowedReleaseGroups"); }
set { SetValue("AllowedReleaseGroups", value); }
}
public string PneumaticDirectory
{
get { return GetValue("PneumaticDirectory", String.Empty); }
@ -479,6 +472,12 @@ namespace NzbDrone.Core.Configuration
set { SetValue("NzbgetRecentTvPriority", (int)value); }
}
public string NzbRestrictions
{
get { return GetValue("NzbRestrictions", String.Empty); }
set { SetValue("NzbRestrictions", value); }
}
private string GetValue(string key)
{
return GetValue(key, String.Empty);

View File

@ -61,7 +61,6 @@ namespace NzbDrone.Core.Configuration
string PlexUsername { get; set; }
string PlexPassword { get; set; }
Boolean MetadataUseBanners { get; set; }
string AllowedReleaseGroups { get; set; }
string PneumaticDirectory { get; set; }
string RecycleBin { get; set; }
int RssSyncInterval { get; set; }
@ -77,6 +76,7 @@ namespace NzbDrone.Core.Configuration
Int32 NzbgetPriority { get; set; }
PriorityType NzbgetBacklogTvPriority { get; set; }
PriorityType NzbgetRecentTvPriority { get; set; }
string NzbRestrictions { get; set; }
string GetValue(string key, object defaultValue, bool persist = false);
void SetValue(string key, string value);
void SaveValues(Dictionary<string, object> configValues);

View File

@ -29,7 +29,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
_logger.Trace("Beginning release group check for: {0}", subject);
var allowed = _configService.AllowedReleaseGroups;
//Todo: Make this use NzbRestrictions - How should whitelist be used? Will it override blacklist or vice-versa?
//var allowed = _configService.AllowedReleaseGroups;
var allowed = "";
if (string.IsNullOrWhiteSpace(allowed))
return true;