Misc History Improvements

This commit is contained in:
Qstick
2020-10-23 01:09:34 -04:00
parent eca9b87571
commit 4b66d99029
32 changed files with 280 additions and 904 deletions
@@ -1,5 +1,9 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.ThingiProvider.Events;
namespace NzbDrone.Core.Applications
{
@@ -10,7 +14,7 @@ namespace NzbDrone.Core.Applications
void DeleteAllForApp(int appId);
}
public class AppIndexerMapService : IAppIndexerMapService
public class AppIndexerMapService : IAppIndexerMapService, IHandle<ProviderDeletedEvent<IApplication>>
{
private readonly IAppIndexerMapRepository _appIndexerMapRepository;
@@ -33,5 +37,10 @@ namespace NzbDrone.Core.Applications
{
return _appIndexerMapRepository.Insert(appIndexerMap);
}
public void Handle(ProviderDeletedEvent<IApplication> message)
{
_appIndexerMapRepository.DeleteAllForApp(message.ProviderId);
}
}
}