diff --git a/NzbDrone.Api/Settings/SettingsModule.cs b/NzbDrone.Api/Settings/SettingsModule.cs index 285b27acc..847954105 100644 --- a/NzbDrone.Api/Settings/SettingsModule.cs +++ b/NzbDrone.Api/Settings/SettingsModule.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Api.Settings if(collection.HasValue && Boolean.Parse(collection.Value)) return _configService.All().AsResponse(); - return _configService.All().ToDictionary(c => c.Key, c => c.Value).AsResponse(); + return _configService.AllWithDefaults().AsResponse(); } } } \ No newline at end of file diff --git a/NzbDrone.Backbone/Settings/Naming/NamingTemplate.html b/NzbDrone.Backbone/Settings/Naming/NamingTemplate.html index 975a07c6c..ea046c316 100644 --- a/NzbDrone.Backbone/Settings/Naming/NamingTemplate.html +++ b/NzbDrone.Backbone/Settings/Naming/NamingTemplate.html @@ -1,4 +1,3 @@ 
Naming settings will go here - {{uGuid}}
\ No newline at end of file diff --git a/NzbDrone.Backbone/Settings/Naming/NamingView.js b/NzbDrone.Backbone/Settings/Naming/NamingView.js index 24e6b7cc4..693b3b4a3 100644 --- a/NzbDrone.Backbone/Settings/Naming/NamingView.js +++ b/NzbDrone.Backbone/Settings/Naming/NamingView.js @@ -14,7 +14,6 @@ define([ initialize: function (options) { this.model = options.model; - var test = 1; }, onRender: function () { diff --git a/NzbDrone.Core/Configuration/ConfigService.cs b/NzbDrone.Core/Configuration/ConfigService.cs index 45210832c..9473c84f6 100644 --- a/NzbDrone.Core/Configuration/ConfigService.cs +++ b/NzbDrone.Core/Configuration/ConfigService.cs @@ -15,7 +15,6 @@ namespace NzbDrone.Core.Configuration private readonly Logger _logger; private static Dictionary _cache; - public ConfigService(IConfigRepository repository, Logger logger) { _repository = repository; @@ -23,12 +22,28 @@ namespace NzbDrone.Core.Configuration _cache = new Dictionary(); } - public IEnumerable All() { return _repository.All(); } + public Dictionary AllWithDefaults() + { + var dict = new Dictionary(); + + var type = GetType(); + var properties = type.GetProperties(); + + foreach(var propertyInfo in properties) + { + var value = propertyInfo.GetValue(this, null); + + dict.Add(propertyInfo.Name, value); + } + + return dict; + } + public virtual String NzbsOrgUId { get { return GetValue("NzbsOrgUId"); } @@ -202,7 +217,6 @@ namespace NzbDrone.Core.Configuration set { SetValue("DefaultQualityProfile", value); } } - public virtual Boolean XbmcUpdateLibrary { get { return GetValueBoolean("XbmcUpdateLibrary"); } @@ -248,7 +262,6 @@ namespace NzbDrone.Core.Configuration set { SetValue("UpdateUrl", value); } } - public virtual string SmtpServer { get { return GetValue("SmtpServer", String.Empty); } @@ -292,7 +305,6 @@ namespace NzbDrone.Core.Configuration set { SetValue("SmtpToAddresses", value); } } - public virtual string TwitterAccessToken { get { return GetValue("TwitterAccessToken", String.Empty); } @@ -304,7 +316,6 @@ namespace NzbDrone.Core.Configuration get { return GetValue("TwitterAccessTokenSecret", String.Empty); } set { SetValue("TwitterAccessTokenSecret", value); } } - public virtual string GrowlHost { @@ -317,7 +328,6 @@ namespace NzbDrone.Core.Configuration get { return GetValue("GrowlPassword", String.Empty); } set { SetValue("GrowlPassword", value); } } - public virtual string ProwlApiKeys { diff --git a/NzbDrone.Core/Configuration/IConfigService.cs b/NzbDrone.Core/Configuration/IConfigService.cs index 98da64eed..b4b7fa469 100644 --- a/NzbDrone.Core/Configuration/IConfigService.cs +++ b/NzbDrone.Core/Configuration/IConfigService.cs @@ -9,6 +9,7 @@ namespace NzbDrone.Core.Configuration public interface IConfigService { IEnumerable All(); + Dictionary AllWithDefaults(); String NzbsOrgUId { get; set; } String NzbsOrgHash { get; set; } String NzbsrusUId { get; set; }