diff --git a/src/NzbDrone.Core/Indexers/IndexerSettingUpdatedEvent.cs b/src/NzbDrone.Core/Indexers/IndexerSettingUpdatedEvent.cs deleted file mode 100644 index 783948b2e..000000000 --- a/src/NzbDrone.Core/Indexers/IndexerSettingUpdatedEvent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using NzbDrone.Common.Messaging; -using NzbDrone.Core.ThingiProvider; - -namespace NzbDrone.Core.Indexers -{ - public class IndexerSettingUpdatedEvent : IEvent - { - public string IndexerName { get; private set; } - public IProviderConfig IndexerSetting { get; private set; } - - public IndexerSettingUpdatedEvent(string indexerName, IProviderConfig indexerSetting) - { - IndexerName = indexerName; - IndexerSetting = indexerSetting; - } - } -} \ No newline at end of file diff --git a/src/NzbDrone.Core/Indexers/SeedConfigProvider.cs b/src/NzbDrone.Core/Indexers/SeedConfigProvider.cs index e99659a4e..7dc44de98 100644 --- a/src/NzbDrone.Core/Indexers/SeedConfigProvider.cs +++ b/src/NzbDrone.Core/Indexers/SeedConfigProvider.cs @@ -6,6 +6,7 @@ using NzbDrone.Core.Download.Clients; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.ThingiProvider.Events; namespace NzbDrone.Core.Indexers { @@ -15,7 +16,7 @@ public interface ISeedConfigProvider TorrentSeedConfiguration GetSeedConfiguration(int indexerId, bool fullSeason); } - public class SeedConfigProvider : ISeedConfigProvider, IHandle + public class SeedConfigProvider : ISeedConfigProvider, IHandle> { private readonly IIndexerFactory _indexerFactory; private readonly ICached _cache; @@ -71,7 +72,7 @@ private SeedCriteriaSettings FetchSeedCriteria(int indexerId) } } - public void Handle(IndexerSettingUpdatedEvent message) + public void Handle(ProviderUpdatedEvent message) { _cache.Clear(); } diff --git a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs index 58eb38479..7167a17d9 100644 --- a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs +++ b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs @@ -103,7 +103,10 @@ public TProviderDefinition Get(int id) public virtual TProviderDefinition Create(TProviderDefinition definition) { - return _providerRepository.Insert(definition); + var result = _providerRepository.Insert(definition); + _eventAggregator.PublishEvent(new ProviderUpdatedEvent(result)); + + return result; } public virtual void Update(TProviderDefinition definition)