diff --git a/NzbDrone.Backbone/Settings/Naming/NamingView.js b/NzbDrone.Backbone/Settings/Naming/NamingView.js
index da1ce061e..85d0bd07a 100644
--- a/NzbDrone.Backbone/Settings/Naming/NamingView.js
+++ b/NzbDrone.Backbone/Settings/Naming/NamingView.js
@@ -11,7 +11,7 @@ define([
ui: {
switch: '.switch',
- tooltip: '.help-inline i'
+ tooltip: '[class^="help-inline"] i'
},
onRender: function () {
diff --git a/NzbDrone.Core/Configuration/ConfigService.cs b/NzbDrone.Core/Configuration/ConfigService.cs
index ecf02ca9a..1d1e578ef 100644
--- a/NzbDrone.Core/Configuration/ConfigService.cs
+++ b/NzbDrone.Core/Configuration/ConfigService.cs
@@ -29,7 +29,7 @@ public IEnumerable All()
public Dictionary AllWithDefaults()
{
- var dict = new Dictionary();
+ var dict = new Dictionary(StringComparer.InvariantCultureIgnoreCase);
var type = GetType();
var properties = type.GetProperties();
@@ -545,6 +545,7 @@ public string GetValue(string key, object defaultValue, bool persist = false)
{
EnsureCache();
+ key = key.ToLowerInvariant();
string dbValue;
if (_cache.TryGetValue(key, out dbValue) && dbValue != null && !String.IsNullOrEmpty(dbValue))
@@ -571,6 +572,8 @@ private void SetValue(string key, int value)
public void SetValue(string key, string value)
{
+ key = key.ToLowerInvariant();
+
if (String.IsNullOrEmpty(key))
throw new ArgumentOutOfRangeException("key");
if (value == null)
@@ -595,17 +598,17 @@ public void SetValue(string key, string value)
public void SaveValues(Dictionary configValues)
{
- //Todo: make this not suck - we need the pascal case of the key
- //Todo: Can we batch save this without savig default values? Or do we care?
-
var allWithDefaults = AllWithDefaults();
foreach(var configValue in configValues)
{
object currentValue;
allWithDefaults.TryGetValue(configValue.Key, out currentValue);
+ if (currentValue == null) continue;
- if (!configValue.Equals(currentValue))
+ var equal = configValue.Value.ToString().Equals(currentValue.ToString());
+
+ if (!equal)
SetValue(configValue.Key, configValue.Value.ToString());
}
}