mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Settings return with default values (via reflection)
This commit is contained in:
parent
3430ad3ee8
commit
62c1be1634
@ -25,7 +25,7 @@ private Response GetAllSettings()
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
<div>
|
||||
Naming settings will go here
|
||||
{{uGuid}}
|
||||
</div>
|
@ -14,7 +14,6 @@ define([
|
||||
|
||||
initialize: function (options) {
|
||||
this.model = options.model;
|
||||
var test = 1;
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
|
@ -15,7 +15,6 @@ public class ConfigService : IConfigService
|
||||
private readonly Logger _logger;
|
||||
private static Dictionary<string, string> _cache;
|
||||
|
||||
|
||||
public ConfigService(IConfigRepository repository, Logger logger)
|
||||
{
|
||||
_repository = repository;
|
||||
@ -23,12 +22,28 @@ public ConfigService(IConfigRepository repository, Logger logger)
|
||||
_cache = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Config> All()
|
||||
{
|
||||
return _repository.All();
|
||||
}
|
||||
|
||||
public Dictionary<String, Object> AllWithDefaults()
|
||||
{
|
||||
var dict = new Dictionary<String, Object>();
|
||||
|
||||
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 @@ public virtual int DefaultQualityProfile
|
||||
set { SetValue("DefaultQualityProfile", value); }
|
||||
}
|
||||
|
||||
|
||||
public virtual Boolean XbmcUpdateLibrary
|
||||
{
|
||||
get { return GetValueBoolean("XbmcUpdateLibrary"); }
|
||||
@ -248,7 +262,6 @@ public virtual string UpdateUrl
|
||||
set { SetValue("UpdateUrl", value); }
|
||||
}
|
||||
|
||||
|
||||
public virtual string SmtpServer
|
||||
{
|
||||
get { return GetValue("SmtpServer", String.Empty); }
|
||||
@ -292,7 +305,6 @@ public virtual string SmtpToAddresses
|
||||
set { SetValue("SmtpToAddresses", value); }
|
||||
}
|
||||
|
||||
|
||||
public virtual string TwitterAccessToken
|
||||
{
|
||||
get { return GetValue("TwitterAccessToken", String.Empty); }
|
||||
@ -304,7 +316,6 @@ public virtual string TwitterAccessTokenSecret
|
||||
get { return GetValue("TwitterAccessTokenSecret", String.Empty); }
|
||||
set { SetValue("TwitterAccessTokenSecret", value); }
|
||||
}
|
||||
|
||||
|
||||
public virtual string GrowlHost
|
||||
{
|
||||
@ -317,7 +328,6 @@ public virtual string GrowlPassword
|
||||
get { return GetValue("GrowlPassword", String.Empty); }
|
||||
set { SetValue("GrowlPassword", value); }
|
||||
}
|
||||
|
||||
|
||||
public virtual string ProwlApiKeys
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ namespace NzbDrone.Core.Configuration
|
||||
public interface IConfigService
|
||||
{
|
||||
IEnumerable<Config> All();
|
||||
Dictionary<String, Object> AllWithDefaults();
|
||||
String NzbsOrgUId { get; set; }
|
||||
String NzbsOrgHash { get; set; }
|
||||
String NzbsrusUId { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user