User can now configure RSS Sync Interval

This commit is contained in:
Mark McDowall
2013-08-05 22:22:58 -07:00
parent 3a3d43b702
commit 083f649b5c
6 changed files with 50 additions and 11 deletions

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.Download;
using NzbDrone.Core.Download.Clients.Nzbget;
using NzbDrone.Core.Download.Clients.Sabnzbd;
@@ -16,12 +18,14 @@ namespace NzbDrone.Core.Configuration
public class ConfigService : IConfigService
{
private readonly IConfigRepository _repository;
private readonly IMessageAggregator _messageAggregator;
private readonly Logger _logger;
private static Dictionary<string, string> _cache;
public ConfigService(IConfigRepository repository, Logger logger)
public ConfigService(IConfigRepository repository, IMessageAggregator messageAggregator, Logger logger)
{
_repository = repository;
_messageAggregator = messageAggregator;
_logger = logger;
_cache = new Dictionary<string, string>();
}
@@ -63,6 +67,8 @@ namespace NzbDrone.Core.Configuration
if (!equal)
SetValue(configValue.Key, configValue.Value.ToString());
}
_messageAggregator.PublishEvent(new ConfigSavedEvent());
}
public String SabHost
@@ -238,6 +244,13 @@ namespace NzbDrone.Core.Configuration
set { SetValue("ReleaseRestrictions", value); }
}
public Int32 RssSyncInterval
{
get { return GetValueInt("RssSyncInterval", 15); }
set { SetValue("RssSyncInterval", value); }
}
private string GetValue(string key)
{
return GetValue(key, String.Empty);