diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs index 8b1959c65..58424949b 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs @@ -6,6 +6,7 @@ namespace NzbDrone.Core.HealthCheck.Checks { + [CheckOn(typeof(ProviderAddedEvent))] [CheckOn(typeof(ProviderUpdatedEvent))] [CheckOn(typeof(ProviderDeletedEvent))] public class DownloadClientCheck : HealthCheckBase diff --git a/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs index b856693c0..0ac4042cd 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs @@ -5,6 +5,7 @@ namespace NzbDrone.Core.HealthCheck.Checks { + [CheckOn(typeof(ProviderAddedEvent))] [CheckOn(typeof(ProviderUpdatedEvent))] [CheckOn(typeof(ProviderDeletedEvent))] [CheckOn(typeof(ProviderStatusChangedEvent))] diff --git a/src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs index 467445ac2..e4aa0c65e 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/IndexerSearchCheck.cs @@ -5,6 +5,7 @@ namespace NzbDrone.Core.HealthCheck.Checks { + [CheckOn(typeof(ProviderAddedEvent))] [CheckOn(typeof(ProviderUpdatedEvent))] [CheckOn(typeof(ProviderDeletedEvent))] [CheckOn(typeof(ProviderStatusChangedEvent))] diff --git a/src/NzbDrone.Core/ThingiProvider/Events/ProviderAddedEvent.cs b/src/NzbDrone.Core/ThingiProvider/Events/ProviderAddedEvent.cs new file mode 100644 index 000000000..3b232b0c7 --- /dev/null +++ b/src/NzbDrone.Core/ThingiProvider/Events/ProviderAddedEvent.cs @@ -0,0 +1,14 @@ +using NzbDrone.Common.Messaging; + +namespace NzbDrone.Core.ThingiProvider.Events +{ + public class ProviderAddedEvent : IEvent + { + public ProviderDefinition Definition { get; private set; } + + public ProviderAddedEvent(ProviderDefinition definition) + { + Definition = definition; + } + } +} diff --git a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs index 750f0cf3d..b37aefda9 100644 --- a/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs +++ b/src/NzbDrone.Core/ThingiProvider/ProviderFactory.cs @@ -98,7 +98,9 @@ public TProviderDefinition Get(int id) public virtual TProviderDefinition Create(TProviderDefinition definition) { - return _providerRepository.Insert(definition); + var addedDefinition = _providerRepository.Insert(definition); + _eventAggregator.PublishEvent(new ProviderAddedEvent(definition)); + return addedDefinition; } public virtual void Update(TProviderDefinition definition)